please note: i have not read your entire code.
You should ALWAYS check for errors on file operation. At least at the open process:
// Open the file with input mode and concatenation
arquivo.open("ArquivoDeDados.txt", fstream::in | fstream::app);
// Writing the information
if(informacao == '@') // If the information is an "@", turned into a string
[...]
you will never know if you opened the file correctly
here the same:
// Open in "reading" and "replace modes
arquivo.open("ArquivoDeDados.txt", fstream::out | fstream::trunc);
i am also pretty sure that you mess with the std::in and std::out flags. Use std::out if you want to write to a file, and std::in if you want to read...
This are general programming (std specific) problems. For future reading ask on a c++ site, this forum is the wrong place for this kind of questions. You can also find help here:
http://en.cppreference.com/w/cpp/io/basic_fstreamThe c::b related part af your problem:
If you launch a program trough c::b the default search path for your program is the base project folder. So if your file structure looks like this:
MyProgram/MyProgram.cbp
MyProgram/bin/Debug/MyProgram
and you read a file from MyProgram with relative paths (as you do) then your program will search in MyProgram/ folder for the files
If you start your program from the explorer it will search in its own Folder for the file.
So your problem is probably that the files are in the wrong place, but you will never know, because you don't make any error checking.
You can set the search path for your program in Project->Properties->Build Targets->Execution Working dir (note only if you start it from c::b)
And don't blame c::b for this "weird" behaviour. This is a useful feature that most programmer will use. As far as i know also VS uses this principle.
greetings