Sunday, September 20, 2009

First Challenge - OOP344 - Armin Kumarshellah

I Realize this is a little late, but I had to do it to prove to myself that I'm not a total slacker. I also know that it is not the shortest piece of code but if you have any suggestions, I welcome your advice. Thank you.



void GetInt(char *strint, int val) {
int x=1, i=0, k=val;
for(i=0;k>x;i++){
x*=10;
}
x/=10;
for(i=0;x>=1;i++){
k/=x;
val -= (k*x);
strint[i]=(k+48);
k=val;
x/=10;}
}

No comments:

Post a Comment