I am working on a project that requires I write to a file. I followedthe example but I don't know if I need to make a file first.In class the teacher just exicuted this text.Did she have an existing file ?Or,should this module create and open one for me?
If you try to open a file for writing and it doesn't exist then it automatically creates it.
If you try to open it for reading and it doesn't exist then the "file.isopen()" will return false.
ios::app means that you are gonna write at the end so the file is for writing. You should use "ios::out" also to specify that the file is for output.
It is not neccesary to be "Acme.txt" . It might be a file named "Acme" without any extension.
thank you for the help. I am sorry for posting the wrong area-- I thought I was still in the begginers area.I must have changed out while looking for other posts about files.