hhhum - Random Code
Tuesday, May 21, 2013
int AscToInt(const char *num) Function
int AscToInt(const char *num){
int number = 0;
bool neg = false;
if(*num == '-'){
neg = true;
num++;
}
while(*num){
number = number * 10 + (*num-48);
num++;
}
if(neg){
number *= -1;
}
return number;
}
No comments:
Post a Comment
Newer Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment