The problem here is that it creates the file 'test.txt' but when it comes time to write to the file it does nothing ... I already saw the file permission and it's ok ... I did not understand, could anyone help me?
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <string>
using namespace std;
int main()
{
int numero;
string name;
ofstream outFile;
outFile.open("c:\x\test.txt");
if (! outFile)
{
cout << "erro test.txt" << endl;
abort();
}
cout << "Name: \n"
<< "Fim de arquivo (Ctrl-Z) termina a entrada de dados\n\n? ";
while(cin >> numero >> name){
outFile << numero << " " << name<< '\n'; // << Chega aqui ele não faz nada
cout << "? ";
}
outFile.close();
return 0;
}