C++ PrintInt
Posted: Thu May 15, 2003 12:44 pm
whats the best way to write a print integer function?
i wrote my function by divinding the number by 10 in a loop and since its an integer i just subtract from the orginal.
for example the number 1234:
int temp=number/10; (temp now is 123 because its an int). then times by 10. (temp is now 1230)
print(numtoascii(number-temp)
are there any more effeciant ways of doing this printint function?
i wrote my function by divinding the number by 10 in a loop and since its an integer i just subtract from the orginal.
for example the number 1234:
int temp=number/10; (temp now is 123 because its an int). then times by 10. (temp is now 1230)
print(numtoascii(number-temp)
are there any more effeciant ways of doing this printint function?