Hello all!
How would I reverse a number that is given by the user?? I have no idea how to do this! I'm using a regular Console App and also using C not C++
can somebody explain to me the steps I need to take?
thanks!
-Emo
Printable View
Hello all!
How would I reverse a number that is given by the user?? I have no idea how to do this! I'm using a regular Console App and also using C not C++
can somebody explain to me the steps I need to take?
thanks!
-Emo
1 Store the number in a string
2 Declare another char[] of same strlen
3 Copy the constant at x position of char1 to strlen-x position of char2
4 Do an atoi or atol
Thanks!
though, I didnt understant what you mean by teh 4th step...
-Emo
atoi converts a string to an integer. I have a nagging feeling it's not a standard function though...that could be itoa....perhaps.
Nope, atoi is standard, itoa is not.