I have to write a main function which uses a loop and pointer arithmetic to print the values of an array, but am not sure how to do this.
I have got the following so far, which may not be correct:
#include <stdio.h>
int *ptr;
ptr = &my_array[0];
int main (void)
{
my_array[] = {1,23,17,4,-5,100};
ptr = &my_array[0];
}
any help would be much appreciated. Thanks