The First homework for SoftWare Testing
I have met a simple error in the past project. In this project, I have to deal with the data first, because I need to use the paraView to read the data, and the raw data format was not suitable for this software. I use codeblocks to write the code, and I want to use fstream to do some file processing. So I write a code like this:
fstream fout;
fout.open(name0, ios::binary|ios::out);
but it did not work, so I looked up the data and tried to find the error, and I suddenly recognized that the name0 is a string, and the fout.open could not accept a string directly, it should transform to a cstring, so I added a transformation, and the code had been passed.
Correct: fout.open(name0.c_str(), ios::binary|ios::out);