Original Post
I'm using the this following piece of code: int num =0; std::string myString; num = (int)myString.c_str(); to turn an std::string into an int value to be stored elsewhere. It doesn't work the same everytime though. num is given a different value for the same string. Why is that? Would I better off to write my own string to int function?