C++ ProgrammingGeneral discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
ifstream fin;
ofstream fout;
fin("file.whatever"): /* to open for input */
fin.close();
fout("file.whatever"); /* open for output */
fout << "line written to file"";
fout.close();
return 0;
}
/************************************************** ************
Try to learn from this, these are my 2nd excersizes, from
the subject "Object oriented programming"!
The goal was to implement "file.cpp" and "file.h" files for
the "main.cpp" program to work properly
************************************************** ************/
//main.cpp
#include <iostream>
#include <string>
bool create_file(const std::string& filename){
file f;