@bamu wrote:
Okay, here’s a stupid question?
Where do I put a “.txt” file to read with fopen?
I’ve copied the file into every single subfolder within my project, and I’m still returning null.
I’ve double checked the file name, and code and don’t see an issue.
I have no problem doing this outside of an OF project.
Here’s the current list of folders the file is saved in…
root,bin, obj, src, data, Debug, & src
Thanks for your help.
code:
FILE *fp;
float test;
if ((fp = fopen(“amd.txt”, “r”)) != NULL) {
fscanf(fp, “%f”, &test);
fclose(fp);
cout << test;
}
else { cout << “NULL BRO”; }
Posts: 2
Participants: 1