I wonder in the code below that why the result of i and j is different.To my intuition,b also pointed to the address of a char with value 4.why do the result of i and j is different
char c='4';
const char *b;
int i,j;
i=atoi(string(1,c).c_str());
b=string(1,c).c_str();
j=atoi(b);
cout<<i<<" "<<j<<endl;