Hi i got the following code am trying to understand:
Its the bit in red above. I thought you have to dereference to get the value so shouldnt it be:Code:#include <stdio.h> #include <stdlib.h> int main(void) { int *x; int i; x = (int *) malloc ( sizeof(int) * 100); for(i = 0; i < 100; i++) x[i] = i; for(i = 0; i < 100; i++) printf("%d ",x[i]); printf("\n"); free (x); for(i = 0; i < 100; i++) printf("%d ",x[i]); printf("\n"); }
printf("%d ",*x[i]);?