Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke

4th Edition

0136086535, 9780136086536

More Books

Students also viewed these Databases questions

Question

8. How would you explain your decisions to the city council?

Answered: 1 week ago