String Concatenation in C
Level 390 keystrokes
Uses strcat to concatenate two strings together.
C code
// Room for 20 chars: "Hello" uses 6 now, and the result needs 121char str1[20] = "Hello";// The text to append; it starts with a space2char str2[] = " World";// Copy str2 over the '\0' of str1 and add a new '\0'; str1 must have enough room3strcat(str1, str2);// Print Hello World4printf("%s\n", str1);Output
Hello World
Practice typing this code. Results are not recorded in the rankings.
Symbols in this code
The symbols you type in this C code and how often they appear.
"× 6;× 4,× 2(× 2)× 2[× 2]× 2=× 2\× 1%× 1