I am trying to call atoi() on the following strings: "54" and "54df4". While the first input gave me the correct result of 54, the call on second string also gave me the result of 54. I assume that the function is converting the string to decimal as far as possible; instead, it should not convert at all. Why is this so? The following is my code:
cout << "Wrong: " << atoi("54df4") << endl;
Thanks,Rakesh.