hi everyone ;)
i'm am having a problem, can you help me how to save big number into array?
i have to input two big numbers (20 digits or less) and sum them.
please help
harryoma 0 Newbie Poster
Recommended Answers
Jump to PostYou could use atoi or write your own char-to-digit converter, like this:
int char2int(char c) { switch(c) { case '0': { return 0; } case '1': { return 1; } // ... and so on } }
You could also do it without the …
Jump to PostI hope this is not homework, so I'll show you a little more (it's simpler than it seems!)
#include <iostream> #include <string> using namespace std; int char2int(char c) { switch(c) { case '0': { return 0; } case '1': { return 1; } case '2': { return …
Jump to Postint char2int(char c) { switch(c) { case '0': { return 0; } case '1': { return 1; } case '2': { return 2; } case '3': { return 3; } case '4': { return 4; } case '5': { return 5; } case '6': { return 6; …
Jump to Postbut getline only works with letters not with numbers
strange... what if my name is U2 ?
All 13 Replies
ddanbe 2,724 Professional Procrastinator Featured Poster
harryoma 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
harryoma 0 Newbie Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
harryoma 0 Newbie Poster
mrboolf 122 Junior Poster
harryoma 0 Newbie Poster
mrboolf 122 Junior Poster
VernonDozier 2,218 Posting Expert Featured Poster
harryoma 0 Newbie Poster
mrboolf 122 Junior Poster
ddanbe 2,724 Professional Procrastinator Featured Poster
mrboolf commented: lol +2
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.