Luc's tecnical Blog :'Cogito ergo sum'
Showing posts with label
bug-free
.
Show all posts
Showing posts with label
bug-free
.
Show all posts
Thursday, March 24, 2011
atoi bug free C cod. My atoi.
int atoi( char* pStr )
{
int iRetVal = 0;
if ( pStr )
{
while ( *pStr && *pStr <= '9' && *pStr >= '0' )
{
iRetVal = (iRetVal * 10) + (*pStr - '0');
pStr++;
}
}
return iRetVal;
}
Older Posts
Home
Subscribe to:
Posts (Atom)