|
-
April 7th, 2013, 06:57 PM
#2
Re: Help with recursive function
In fact you can't do that at all with the integer variable alone. It stores the integral number as such, but no number formatting information whatsoever. (In fact, even though it's commonly output in decimal for easy reception by humans, the integer varable isn't even decimal.)
As I understand your assignment, it's asking you to convert the integer into a string in an appropriate way (as you already suggesed) and then print that. You're not even required to preserve the string holding the conversion result; you can simply discard it after printing. And, in particular, you're not required to put the formatted integer value back into the original integer variable, which would be impossible anyway, as pointed out above.
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|