Whenever you ask a question about an error, ALWAYS post a message on the line that has the error, like this:
Code:
int n = 10.5; //***ERROR***
Or, post the error message along with the line of code:
error message saying : cannot convert from 'std::string' to 'const char *'.
which is this line of code:
int n = 10.5;
You can't assign a string type to a variable that is of type const char*. This code makes no sense:
Code:
string myStringErrors;
...
const char* myStringNoSpaces = myStringErrors;
string str(myStringNoSpaces)
You try to convert myStringErrors from a string type to a const char*. Then you convert the result back to a string type. Hello? You had a string type to start with.