Home / Code typing practice / C

Free code typing practice

C Typing Practice

Free C typing practice: type real C code with pointers, structs, for loops and printf format strings. Train the *, &, # and \n characters C programmers type all day.

C is compact and symbol-heavy: pointers with * and &, preprocessor lines starting with #, format strings with % and escape sequences like \n. Each line is short, but nearly every one has a reach to the number row.

The snippets cover #include, printf, for and while loops, malloc and strcpy, and typedef struct, the core of embedded and systems programming.

C code you will type

Each session picks from these, in random order. Line breaks are shown as single spaces.

#include <stdio.h> int main(void) { printf("Hello, %s\n", "world"); return 0; }
for (int i = 0; i < n; i++) { sum += arr[i]; }
char *copy = malloc(strlen(src) + 1); if (copy != NULL) { strcpy(copy, src); }
typedef struct { int x; int y; } Point;
while ((c = getchar()) != EOF) { if (c == '\n') { lines++; } }

Symbols to watch

*&#%\{ };++

Not sure which finger to use? See the programming symbols finger chart.

Tips for typing C faster

  • The asterisk is Shift and 8: right middle finger, left Shift.
  • Backslash is on the right edge above Enter; reach with your right little finger and come straight back.
  • Type ++ and != as single movements, the same way you type common letter pairs.

Frequently asked questions

Why is C typing practice useful?

C uses pointers, format strings and the preprocessor, so it trains *, &, %, # and \ more than most languages.

Does C practice help with C++?

Yes. Almost all C syntax is valid C++, so the same reaches apply; C++ then adds templates and ::.

Practise typing other languages

All code typing practice