I've got a text file that I need to output to the screen. The text file contain's blank lines, which also need to be outputted to the screen. The code which i'm using at the mo is:
Getline is just ignoring blank lines, and going onto the next bit of data.
cout << Buffer;
File >> ws;
Are you sure? Try a newline on your cout to be sure.
cout << Buffer << endl;
Tried a new line, still does the same. Debugger shows getline ignoring the any blank lines.
getline's default deliminating character is \n
instead try file.getline(Buffer, 100, EOF);
not sure if EOF can be used this way or not
1 2 3 4
char filename = //whatever;
fin.getline(buffer, 11);//ignore newline at end of first line
fin >> ws;//store second new line in ws
for (int i = 0; i < 4; i++)
fin >> array[i];
or read entire file in one char at a time
int i = 0;
while(fin.get(ch) && i < 50)
buffer[i++] = ch;