i'm new to c++....i'm making a project here but i have a problem with this: reading values as type char and converting it to type int...such that 54 can be read as '5' and '4' but after that it will be read into type int...can anyone please tell me how?
c++ prog 0
Light Poster
Recommended Answers
Jump to PostI assume you are not allowed to use standard C functions such as atoi() ? If you have to do your own thing then just subtract '0' from the digit and add the result to an int accumulator. For the second digit multiply the accumulator by 10 and repeat the …
All 2 Replies
Ancient Dragon 5,243
Achieved Level 70 Team Colleague Featured Poster
Narue 5,707
Bad Cop Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.