Const char* to char*

Hi

Can anybody tell me why does it works :

#include
void sample()
{
string a=“blabla”;
char *b;
b=a.c_str(); // ???

cout<<b<<endl;
}

I’m not a guru of c++, but shouldn’t be a warning while convert from const char* to char* ?

Regards
jimmij

Hi,

You are indeed correct. However note that CINT is error checking is in general intentionally more relaxed. This error will be properly caught be
the compiler.

Cheers,
Philippe.