Originally posted by CornedBee
Code:
#include <string>
using std::string;

string s("Hello there");
// dumdidum
// cast, else compiler error
char * cs = (char *)s.c_str();
If you now modify cs you have problems again. Casting away const is never good and means that something with your code design is wrong. The const modifier is really great.
I don't think you're allowed that last one, I thought you needed const_cast It might have changed though.