>>fpData=fopen("pj.dat","r");
dont forget to check out if you opened succefully the file, look:
Code:
if ((fpData = fopen("pj.dat","r")) == NULL) {
//error, couldn't open the file
}
else {
//now do your code.
}
>>scanf("%s",filePath);
for getting strings from a stream, use fgets, and don't forget to check if you have '\n' (fgets when can put, it put) in the string example:
Code:
char *p, filePath[SIZE];
...
fgets(filePath,sizeof(filePath),stdin);
p = strchr(filePath,'\n');
if(p) *p = 0;
For using the strchr() function add string.h
Now for reading, use function like, fgets(), fscanf(), fread() and so on... and for writing fprintf(), fwrite()...