Results for “C++”
Small, practical examples. Search by task or narrow things down below.
Count matching lines
Linux Commands: Use grep -c to count matching lines rather than individual occurrences.
Linux Commands✓ Tested
Count matching values
Count even numbers in a fixed C array.
C✓ Tested
Count newline characters
Count newline bytes in a C file while retaining EOF as an int.
C✓ Tested
Count newline-terminated records
Linux Commands: Count newline-terminated records using GNU/Linux commands in an empty practice directory.
Linux Commands✓ Tested
Count occurrences in a list
Count how often each value appears using Counter from the standard library.
count✓ Tested
Count occurrences in a sorted sequence
C++: equal_range finds the half-open interval containing values equal to the key.
C++✓ Tested
Count repeated lines after sorting
Linux Commands: Group identical lines before uniq -c, then normalize its leading padding.
Linux Commands✓ Tested
Count repeated words
Count repeated words using a complete Go program with explicit sample inputs.
Go✓ Tested
Count rows per category
Aggregate rows sharing the same category.
GROUP BY✓ Tested
Count rows satisfying separate conditions
SQL: SUM over CASE expressions calculates several conditional counts in one scan.
SQL✓ Tested
Count rows satisfying separate conditions
SQL Server: SUM over CASE expressions calculates several conditional counts in one scan.
SQL Server✓ Tested
Count rows satisfying separate conditions
Postgres: SUM over CASE expressions calculates several conditional counts in one scan.
Postgres✓ Tested