Tagged Questions

I have checked several such questions on SO like :
Link 1 and Link 2
But none of their answers is helping me. After spending so many hours in debugging, I am unable to detect the bug.
So, I am asking ...

I am trying to backup a line in an ifstream. file.tellg() is returning a value I was not expecting. In the example bellow, after reading the first line (a string length of 15 characters) I expected ...

I'm new to coding and while doing an fstream exercise i encountered this problem:
I'm trying to write some things to a text file but it won't even create the file (this is the first time I have this ...

I need to write/read a file that contains a std::map. The file must be read at the program start up (if it exists). Im using boost's fstream, but im getting this:
"terminate called after throwing an ...

Hi i am trying to read a file , say for example 'sample.txt', in binary mode-c++ and i need to store the file text (eg."nodeA nodeB") in a vector .
eg:
"A A B E A B G"
if this is what is in the text ...

I'm building a simpler version of xxd for a school project and I'm getting hung up on the file output when reading binary files only (i.e. when I read plain text files, everything works as expected).
...

I am making a game, and I am trying to make it write all of the variables to a file, then be able to read it again when you open up the program, therefore saving your progress. Is there any simple way ...

I'm currently working on this code that would create a batch file with the command to ping a certain IP address. I want it to execute the batch file and log the results to a txt file. For some reason, ...

This program is executing without giving any error. But nothing seems to be written or read from test.txt.
Please help me spot the mistake. I feel I have implemented ofstream and ifstream correctly. ...

Sorry for the title, but I really have no idea what the problem is. The code looks like that (here it has no sense, but in the bigger project is has, so please, do not ask "why do you want to do....")
...