Cohesive Explanation of I/O Streams Needed

The issue I am having is that while I am attempting to understand the basics of writing data to and from files on my computer, all of the explanations I have read only describe the specifics of what needs to be written in code, but is there not the aspect of having the file being written to/from located in the correct place? Is there not the factor to be taken into consideration that for my class, we are to use IDEs in code editing? Does this not make the process problematic? I use Xcode. I write the code. I tell the code to open a file. I create the text file on my desktop. I hit the compile button on Xcode. Naturally, nothing happens. What do I need to know to get this to work?

Honestly, my teacher is completely disorganized, and I suspect he may have glossed over the necessary information to make the class understand this.
Last edited on
If you want to be sure the file will be opened, you could specify the full path including drive letter, as well as the name of the file.

Alternatively you might specify a relative path, such as a directory lower or higher in the file system hierarchy.
Last edited on
Topic archived. No new replies allowed.