Fog Creek Software
Discussion Board

atoi right to left method solution problem

The solution has a little problem at the while loop line. (*pCur <= '9' && *pCur >= '0') should not be in the while condition, or for some string like "123A", it will just return 0 instead of "123".

Stanley Wang
Friday, October 8, 2004

*  Recent Topics

*  Fog Creek Home