char *data; int leng=0; data = (char *)malloc(nFileLen); for (int i = 0; (aa = fgetc(fp)) != EOF;i++) { data[i] = aa; leng++; }
I don’t understand how to operate like this after dynamically allocating memory. Can you explaindata[i]=xxx
I don’t understand this sentence
and when I use it, I use*data
only outputs one character
, but using the loopdata[i]
can output a lot. I’m wondering if it’s not*data[i]