I just started new project in Visual Studio 2017 and I tried to write some text into file. But after I run my code, no file is created.
int main()
{
ofstream file_program("D:\test2.txt", ios::out);
if (file_program.is_open())
{
file_program << "test";
cout << "OK";
file_program.close();
}
int age;
cin >> age;
return 0;
}
What am i doing wrong?