+ 2
Reading words from file
How can I read words from a specific text file in C++? I’m trying to make a program that can search for certain words in a file...
2 Réponses
0
#include <stdio.h>
{
void main();
file*fp;
fp=fpopen("file name .txt","r");
if(fp=NULL)
{
printf(" file not found");
exit(1);
}
ch=fget(fp);
while(!feopen(fp))
{
printf("%c",ch);
ch=fget(fp);
}
fclose(fp)
getch();
}