fstream getline code-optimierung
-
CString dlgOut; ifstream in(fn); while(getline(in, line)){ dlgOut += line.c_str(); dlgOut += "\r\n"; }
jmd ne idee wie man das noch verkuerzen koennte ?
-
Nö.
Was is dlgOut (Datentyp)
Eventuell kannste aber auch die Datei Binär öffnen und kopieren.
Schau mal hier letzter Beitrag (letzte ~10 Zeilen):
http://www.c-plusplus.net/forum/viewtopic.php?t=39470
In Deinem Falle wäre es nicht int sondern char.