Pon-3
Pon-3

Reputation: 143

How do I set the directory for Code::Blocks?

I am trying to run this code in Code::Blocks to test my project:

FILE *tFile = fopen("findloc.txt", "w");

However, it puts the file in Users/Pon3 instead of Users/Pon3/Projects/MyProject which is where I want it to go. How can I fix this in Code::Blocks (Mac OS X Mountain Lion)?

Upvotes: 2

Views: 5929

Answers (1)

Maxime Tremblay-Savard
Maxime Tremblay-Savard

Reputation: 967

"Users/pon3/Projects/MyProject/findloc.txt" would put your text file more specifically were you want.

If you simply write FILE *tFile = fopen("findloc.txt", "w");, your text file is going to be were code::block put his files.

Upvotes: 2

Related Questions