Questions tagged [ofstream]

Output file streams are C++ standard library objects used to write to files.

The C++ standard library type std::ofstream is a specialized std::ostream which uses a std::filebuf to write to a file. std::ofstream is declared in fstream.

Use this tag for questions about std::ofstream or the wide-character version std::wofstream, or the class template std::basic_ofstream. For questions about file I/O in C++ the tags , , and might be relevant. For more general questions about output streams use the or tags.

1006 questions
-6
votes
2 answers

how to write, read and rewrite in a .txt file with c++

i'm a student and i have to create a program and an inform about the use of the program, so ii has to, if the file doesn´t exist, create it; if it exist, read it and save the variable, then it has to increase their value if it meets specific…
1 2 3
67
68