vendredi 27 mars 2020

How to write a custom file using loops? C++

When i try to type the sentence and press enter it does nothing it keeps running. This part of the code is in a class name createFile, the code runs inside a menu using a do while and a switch, when i use the code in a function it runs perfect, but when i use it in a class it never stops.

myFile.open("myText.txt");

cout << "Entre una oracion." << endl;
while (cin >> oracion) {

    myFile << oracion << " ";

}


myFile.close();

Aucun commentaire:

Enregistrer un commentaire