QP School

Full Version: Pointer arithmetic in C
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pointers can be manipulated using arithmetic operations.

int numbers[] = {10, 20, 30, 40, 50};
int *ptr = numbers;

printf("%d\n", *ptr); // Output: 10
ptr++; // Move the pointer to the next element
printf("%d\n", *ptr); // Output: 20