Hey there, How do I go about copying text inside a text file into a multidimensional character array?
supposing the text file( text_file.txt) contained
this is the first line
this is the second line
this is the third line
#include <stdio.h>
int main(void){
FILE *f;
f=fopen("text_file.txt","r");
if (f==NULL){
printf("invalid!");
return 1;
}
else {
printf("successful");
}
char copied_text[80][80];
while (!feof(f)){
int i=0,j=0;
fgets(copied_text[i][j],"%s",f);
i++;
}
return 0;
}
-thank you.