I do not know why I do not read the line break when I save the names to the file. Thanks in advance, who can help me. (I'm using codeblocks)
#include <iostream>
#include<fstream>
using namespace std;
int main()
{
ofstream modificar;
modificar.open("Documento1.txt",ios::binary);
char nombrea[10],nombreb[10],nombrec[10];
cout<<"Ingrese tres nombres"<<endl;
cin.getline(nombrea,10);
cin.getline(nombreb,10);
cin.getline(nombrec,10);
modificar<<nombrea<<endl<<nombreb<<endl<<nombrec<<endl;
modificar.close();
ifstream leer;
leer.open("Documento1.txt");
char linea[40];
leer>>linea;
cout<<linea;
leer.close();
return 0;
}