Hi HashCode.Ru.
Here is the code, but I don’t know how to make the file start when the program is started, and what’s written in the program and what’s written in the file will appear?
#include "stdafx.h" #include <iostream> #include <fstream> #include <iomanip> using namespace std; int main(int argc, char *argv[]) { setlocale(LC_ALL, "rus"); ofstream fout("data_types.txt", ios_base::out | ios_base::trunc); if (!fout.is_open()) // если файл не был открыт { cout << "Файл не может быть открыт или создан\n"; return 1; } getchar(); fout.close(); cout << "Данные успешно записаны в файл data_types.txt\n"; system("pause"); return 0; }
system("pause");
Oh. - drdaemancin.get()
, instead of launching a separate interpreter process andpause
in it, has not been canceled. - drdaeman