C program for reading file
C program for reading text file
Notepad:-
name.txt
Note:-
# name.txt is file name
# fb is file pointer
Program 1:-
C program for reading notepad using fscanf
Output:-
Town1:angalore
dist1:200
Town2:Hubli
dist2:500
Town1:Mysore
dist1:400
Town2:Honnavar
dist2:700
Town1:kumta
dist1:781
Town2:sirsi
dist2:89
Program 2:-
C program for reading notepad using sscanf
Output:-
Town1:Bangalore
dist1:200
Town2:Hubli
dist2:500
Town1:Mysore
dist1:400
Town2:Honnavar
dist2:700
Town1:kumta
dist1:781
Town2:sirsi
dist2:89
Note:-
fp=fopen("e:\\text.txt","a");
# a is used to write at end of file
# a+ is used for both write at end of file and read
# w is used write into file, it will erase old data, if file is not present it will create a file
# w+ is used for both writing and reading into file, it will erase old data, if file is not present it will create a file
# r is used to read file
# r is used for both write and read.if file is not present it will show error.
See Also
c program to create notepad
c program to write data into notepad
c program for writing notepad at end of file
c program for copy string from one notepad to another notepad
fuck u why dont u just write in letter ? why are you needed to make a picture shit !! fuck fuck u motherfucker
ReplyDelete