-
File io
There is a .cpp file that has a function that should write in a file.
I am using file.get(char) to read from a file, but it generates error in streambuf::sputc(). The file I am reading from, is a plain text.
There is also a check for file.good(). After I disable that line program generates error on another line on another file, this time on a file.get() in streambuf::sbumpc().
Error: First-chance exception in writer.exe: 0xC0000005: Access Violation.
[edit]
I was wrong errors occur even in an internal call.
(But it worked once)
[/edit]
:confused:
-
-
Code:
ofstream OpenOfile();
ifstream OpenIfile();
Streams should not be copied around. Use references instead.
Kurt
-
Sorry for old headers, I am learning C++ from a book that uses old headers.
"A Beginners' C++" it's a very good book.
http://www.uow.edu.au/~nabg/ABC/ABC.html#
-