|
|
|
|||||||
» Less advertising throughout
» Post and participate in discussions
» Network with other forum members
» Free private messaging
![]() |
|
|
Thread Tools |
|
Crate&Barrel Roll
|
what jehanum said
cin the character string char by char, run atoi char by char, then output the integer into an array of ints, int by int this will let convert huge strings of chars to massive numbers
__________________
lol |
|
|
#16
|
|
|
Quote:
If uint64_t is available, use that. If that is not enough bits, pull down a bigint library, there are a few that were submitted for inclusion in Boost but didn't make it. Edit: and Graze, dude, not to be a dick, but if you are too ignorant to figure out that you are overflowing an integer, you certainly are not smart enough to properly reinvent this wheel. Last edited by DreamWarrior; 04-26-2012 at 07:31 PM.. |
|
|
|
#17
|
|
|
Quote:
This entire exercise is me learning C++. Don't get on your high horse about it. There were other ways I could have gone about this that would have actually worked but would not have taken me down the path of strol or stroll. Something my 1000 page C++ book never mentions and only mentions atoi eight time. My idea isn't necessarily to successfully reinvent the wheel but what I learn trying. Last edited by Grazehell; 04-26-2012 at 08:48 PM.. |
|
|
|
#18
|
|
|
Quote:
__________________
Your powers are useless! I'm wearing my tin foil underwear! 1992 300ZX: Not stock, 433 RWHP 1971 240Z: Toyota front brakes, 123 RWHP 1967 Pontiac GTO: not stock. |
|
|
|
#19
|
|
|
A char array is not the way to go if you have to do math. If you don't have to do math, then some would argue to always use string (though I don't advocate that sort of useless waste, lol.)
|
|
|
#20
|
|
|
my brain hurts in here.
__________________
"Any human with delicate enough olfactory senses will be able to establish that Tibbles is indeed my cat, since I pissed on her last time I saw her do it." - FLARE I mean my penis is a solid 4" long and it fits fine in the finger. - 0dan0 |
|
|
#21
|
|
My cooter sweats, and reeks like rotting sea vermon.
|
1000 page C++ books and character arrays to do string binary to integer conversion?
Last time I leave my embedded C cave. You guys are nuts.
__________________
Use Linux and BSD |
|
|
#22
|
|
|
Quote:
I'm pretty sure whatever he's doing is in that category anyhow (useless waste).
__________________
Your powers are useless! I'm wearing my tin foil underwear! 1992 300ZX: Not stock, 433 RWHP 1971 240Z: Toyota front brakes, 123 RWHP 1967 Pontiac GTO: not stock. |
|
|
|
#23
|
|
|
Quote:
![]() |
|
|
|
#24
|
|
|
Quote:
The book is fine. But you really can't expect me to learn everything from reading a book? Seems like people a bit confused as to what the program was suppose to do. It was suppose to take in a wall of binary numbers and process them, not just them convert to decimal |
|
|
|
#25
|
|
My cooter sweats, and reeks like rotting sea vermon.
|
Quote:
Mmm... Python. Isn't that the language where you take 100 programmers and give them a problem to solve, and all 100 programs are identical? ![]()
__________________
Use Linux and BSD |
|
|
|
#26
|
|
My cooter sweats, and reeks like rotting sea vermon.
|
Quote:
I would argue that C++ is a silly language and is difficult to learn as an introduction to programming. The language provides so many "features" and some C++ developers get the idea that they need to use all of them in every program they write. Even worse, you get companies that only use a subset of C++ features, for the same reason. With the things you are trying to learn right now, I would suggest you pick up K&R C. It is short, concise, and infinitely useful. Trying to toss in all the silly features of C++ and OOP when you're just trying to learn the basics is counterintuitive. Also, operator overloading is the fucking devil.
__________________
Use Linux and BSD |
|
|
|
#27
|
|
|
Quote:
I occasionally reference that book to this day ('course, I work in C, not C++). I've had it since 1996, I think. Ad hoc polymorphism is proper OOP design, IMO. Of course, badly done overloading takes away from it.
__________________
Your powers are useless! I'm wearing my tin foil underwear! 1992 300ZX: Not stock, 433 RWHP 1971 240Z: Toyota front brakes, 123 RWHP 1967 Pontiac GTO: not stock. |
|
|
|
#28
|
![]() |
Thread Tools |
|
|
|