Question: need help modifying my program to do this Read multiple lines from the file. Store the lines in memory, preferably in an array. Create a

need help modifying my program to do this 
  1. Read multiple lines from the file.
  2. Store the lines in memory, preferably in an array.
  3. Create a function to read the data from memory, and print it to stdout.
 #include  int main() { char buffer[1000]; char fileName[20]; FILE *fptr; printf("Enter file name: "); scanf("%s",&fileName); if ((fptr = fopen(fileName, "r")) == NULL) { printf("Error! opening file"); return 0; } // reads text until newline fscanf(fptr, "%[^ ]", buffer); printf("First line in the file is: %s", buffer); fclose(fptr); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!