Good to see that I'm not the only one confused by this.Originally Posted by quzah
>>And how do you propose we handle situations were a person wants to sum up say like:
12 and 15? Your solution breaks down.
This is immaterial - If I'm not mistaken (and I stand to be corrected by the OP if I am), the
task is to enter a sequence of digits and add all the individual digits entered up - last I checked,
in the base 10 number system, 12 and 15 are not single digits. Basically I think that your
interpretation of the task is to enter a certain amount of numbers (note, not digits) and add
them all up. I don't think that this is the case, and apparently neither does quzah. Quzah's
solution solves his interpretation of the task just fine.
This whole thing could be avoided if the OP had expressed his question more clearly.
A couple more things:
1: >>The wrong number. Ie, undefined behavior.
I think you need to look up your definition of undefined behavior - such as using atoi without
including the correct header - that's undefined, getting the "wrong number" isn't specifically
2: It's never a good idea to challenge "certain" people on this forum (in this case, quzah),
unless you're on rock solid ground - it just doesn't end pretty. Just because you mightn't see
his code lying around here that often, doesn't mean he's not right when he points out people's
mistakes either. Quzah - you either love him or hate him