void EDataset::PrintErr(const NDataString& ErrMsg){
system("echo " + $ErrMsg + " >> err.txt");
.... code ....
}
It prints blank line as the value of ErrMsg. How come?
void EDataset::PrintErr(const NDataString& ErrMsg){
system("echo " + $ErrMsg + " >> err.txt");
.... code ....
}
It prints blank line as the value of ErrMsg. How come?
As already @gf mentioned in the comment, $ErrMsg is not proper. Also, NDataString definition is not clear.
Assuming there is a way to get string out of NDataString :
void PrintErr(const NDataString& ErrMsg)
{
std::stringstream tempString;
tempString <<"echo ";
//Get the string out of NDataString...
//if ErrMsg was std::string then c_str() will give you const char*
tempString<< ErrMsg.c_str();
tempString<<" >> err.txt";
system(tempString.c_str());
}