#include <stdio.h>
int main(){
char *p, *initial;
int c, in=0;
for(initial=p; (c = getchar()) != EOF; p++, in++)
*p = c;
for(int i=0; i<in; i++)
printf("%p = %c\n", initial, *initial++);
}
For an input like hello hai
, the program gives incomplete output:
0028FF29 = h
0028FF2A = e
0028FF2B = l
0028FF2C = l
0028FF2D =
0028FF2E =
0028FF2F =
0028FF30 =
0028FF31 =
It is working fine for small text, but it's not working for large text.