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;}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment