Creating a txt file

I read that you can create a .txt with c++ and I have tried what they suggested and it doesn't work. I am also wondering if you can read a specific line in that .txt files. looking for help on either.

Yeoj
I assume you are using #include <fstream> .

You can use the std::ofstream class to create and write to a file, and the std::ifstream to read from a file. There should be a member function of std::ifstream to seek to a particular location in a file.

Here are the documentation pages on this site.
http://cplusplus.com/reference/iostream/ifstream/
http://cplusplus.com/reference/iostream/ofstream/
Topic archived. No new replies allowed.