Joined
Last Seen
0 Reputation Points
Unknown Quality Score
No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
0 Endorsements
Ranked #54.9K
Re:
How do I read and print just n(10) lines in a file and not whole file. [CODE]#include<stdio.h> #include<string.h> int main() { char line[50]; FILE *datafile; datafile = fopen("/data3", "r"); while(fgets(line,sizeof line,datafile)!=NULL) printf(" %s\n", line); fclose(datafile); return 0; }[/CODE] |
|
Hi, I am writing a piece of code that takes copies the contents of one file to another (which is created by the code, the name is given by user as an arguement). I've managed to successfully open and read in the source file, and the program will create the … |