Question: Write a complete (with all necessary declaration) function called loadMyIncome that: requires an argument as a char pointer to the file name. The function must

Write a complete (with all necessary declaration) function called loadMyIncome that:

requires an argument as a char pointer to the file name.

The function must open the file named in the argument for reading,

Must insure that the file was opened successfully.

Must read the file line by line using fgets storing the read data in char array called myLine assuming that no line is longer that 80 characters (some may be exactly 80 characters long)

Must continue reading until it encounters the end of file.

(Hint use the following syntax for fopen and fgets

FILE * fopen ( const char * filename, const char * mode );

char * fgets ( char * str, int num, FILE * stream );)

Also, please note that you are to write the function only. This means that you do not have to write a main().

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!