07-25-2023, 11:41 AM
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
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