I am using the following piece of code in which I enter a string and it is saved in the file but it does not leave any character in the string because it does not pause, it executes the instructions that go after
const size_t longitud = 100;
char nota[longitud];
fstream archivo(NOMBRE_ARCHIVO.c_str());
if(archivo.good()) {
archivo.open(NOMBRE_ARCHIVO.c_str(), fstream::in | fstream::out | fstream::app);
} else {
archivo.open(NOMBRE_ARCHIVO.c_str(), fstream::in | fstream::out | fstream::trunc);
}
cout << "\n\t Ingrese la nota porfavor" << " ." << endl;
cin.getline(nota, longitud);
archivo << nota << endl;
archivo.close();
break;