I've just constructed a program which reads number of lines in a file.The thing is i've got a problem constructing the getline method.I've already constructed part of the program.When i compile the program, it gives me the name of the file.
I would be very glad if you could help me. The program is as follows :
/*--------------------------Clear Method--------------------------------
* This methos clears the screen
*/
void clear()
{
printf(" ");
}
int getline( FILE *fp, char *line, int max);
/*---------------------main----------------------------
* this is the main part of the program which calls the
* getline method to count number of lines in a file
*/222
main(int argc, char *argv[])
{
char *filename = "input.dat";
FILE *fp;
char line[MAXLINE];
int found = 0;
There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.
fgets(buffer, BUFFER_LEN, fp );
Sunnycoder