anonix
29-03-2020, 21:23
Этот Код должен создавать файл с именем name, но он выдаёт ошибку на 11 строке.
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main () {
setlocale(LC_ALL,"Russian");
string text;
cout << "Введите назване файла!!!" << endl;
ofstream enter;
string name;
getline (cin,name);
enter.open(name);
getline(cin,text);
enter << text;
cout << "Проверь файл!!!";
}
Памагити |:
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
int main () {
setlocale(LC_ALL,"Russian");
string text;
cout << "Введите назване файла!!!" << endl;
ofstream enter;
string name;
getline (cin,name);
enter.open(name);
getline(cin,text);
enter << text;
cout << "Проверь файл!!!";
}
Памагити |: