FILE *fp;
char *f_array[256];
int f_length;
int *a = 0;
fp = fopen("test.txt", "r");
fseek(fp, 0, SEEK_END);
f_length = ftell(fp);
printf("%d\n\n", f_length);
int n = 1, i = 0;
while (n > 0)
{
n = fscanf(fp, "%s", f_array[i]);
i++;
}
I am trying to copy the contents of a .txt file into a char* array. Much like what would happen with InternetReadFile and lpbuffer. However, I cannot seem to get this right. I need my array to be filled with the contents of the .txt file character by character. Any suggestions? I need the array to be single-dimensional