Reputation: 1
I apologise if this is a trivial/stupid question but I'm new to programming and don't quite understand file outputs in C.
I've written some code and the bits to do with the output file are here:
FILE *output_path;
output_path=fopen("myfile.out", "w");
.
.
.
fprintf(output_path, "%lf\n", x);
What I would like to do is view my output but I don't know how to open this file or even locate where it is on my computer. How do I do this?
Upvotes: 0
Views: 112
Reputation: 189
Since the OP is running the program on PuTTY, the cat
command should do the trick.
After execution of the program, run cat myfile.out
to see the contents of the file myfile.out
Upvotes: 0
Reputation: 1349
myfile.out
will be created in your working directory. Normally its the directory where you get you program executed unless you have changed it with chdir
Upvotes: 2