Pointer Increment in C
Level 3101 keystrokes
Uses pointer increment to traverse an array.
C code
// Four values to walk through1int arr[] = {5, 10, 15, 20};// p starts at the first element2int *p = arr;// arr + 4 is the address just past the last element, so the loop stops there3while (p < arr + 4) { // *p++ reads the current value, then moves p to the next element4 printf("%d ", *p++);5}// End the line: 5 10 15 206printf("\n");Output
5 10 15 20
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.
,× 4;× 4"× 4(× 3)× 3+× 3{× 2}× 2*× 2=× 2