Hey guys,
I need to access a text file and store the data into a 3 dimensional array.
I'm having issues getting the info into an array, from there I can manipulate the text as needed. But the first step is stumping me.
Code:#include <stdio.h>
int main(void)
{
int count = 0;
char text[50][50][21];
FILE *ptr_file;
char buf[1000];
ptr_file =fopen("proj4.txt","r");
if (!ptr_file)
return 1;
while (fgets(buf,1000, ptr_file)!=NULL){
text[count] = fgets(buf,1000, ptr_file);
count++;
}
fclose(ptr_file);
getch();
return 0;
}