Create a text file on desktop as “text.txt”,
content of file will be a single line as “FILE
ORGANIZATION AND ACCESS METHODS”. Write a
program to read from file only “ORGANIZATION”
word and print it on screen.
And i am doing that but it does not work .
#include <stdio.h>
#include <conio.h>
int main()
{
FILE * pFile;
char mystring [100];
pFile = fopen ("f:\text.txt" , "r");
if (pFile == NULL) perror ("Error opening file");
else {
fseek ( pFile , 6 , SEEK_SET);
fgets (mystring , 12 , pFile);
puts (mystring);
fclose (pFile);
getch();
}
return 0;
}
Any Idea ?
Thank You