skip to main
|
skip to sidebar
C Programming
Pages
Home
Programs
Pointer
Projects
Solution
How to read a text file by c program | CTechnotips
#include
<stdio.h>
int
main
(){
char
str[70];
FILE *p;
if
((p=fopen(
"string.txt"
,
"r"
))==NULL){
printf(
"\nUnable t open file string.txt"
);
exit(1);
}
while
(fgets(str,70,p)!=NULL)
puts(str);
fclose(p);
return
0;
}
0 comments:
Post a Comment
Newer Post
Older Post
Home
Category
Concepts
(16)
Graphics Program
(3)
Hardware interaction through C
(9)
Pointers Tutorial
(29)
Problem
(1)
Program
(196)
Projects
(3)
Puzzles Program
(7)
Question and Answer
(15)
Solution
(4)
System Program
(9)
Virus Program
(2)
Powered by
Blogger
.
Popular Posts
0 comments:
Post a Comment