12
ofstream myOutFile; myOutFile.open("output.txt");
char filename[] = "C:\\files\\output.txt"; ofstream myOutFile(filename);
12345678910111213
#include <iostream> #include <dir.h> using namespace std; int main() { char buffer[512]; getcwd(buffer, 512); cout << "The current directory is: " << buffer << endl; return 0; }