I'm trying to learn pointers in C, and here is some code I wrote to test it:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
int m = 4;
int *n;
n = &m;
printf("%d\n",*n);
for (*n = 0; *n < 100; *n++){
printf("%d\n",*n);
}
}
As expected, that first part printed 4. But the loop did not go further than 4, and did not go to 100 as I tried to make it.