Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: problem wit...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 4 of 4 Topic 45763 of 46738
Post > Topic >>

Re: problem with a reverse iterator

by Pete Becker <pete@[EMAIL PROTECTED] > May 5, 2008 at 08:34 PM

On 2008-05-05 18:21:52 -0400, brad <byte8bits@[EMAIL PROTECTED]
> said:

> 
> Wow. That works. I do not fully understand why it works, but I wanted 
> to thank you for the advice. I'll research it more until I better 
> understand.
> 

'0' is a character. It happens to also be a number, but it's the number 
that represents the character '0' in whatever encoding the compiler 
uses (typically ASCII). But C and C++ both have a rule that the 
representations of the characters '0' through '9' must be contiguous 
and increasing, that is, '1' is one more than '0', etc. So to convert a 
character that represents a digit into the value of that digit, just 
subtract '0'.

-- 
  Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The 
Standard C++ Library Extensions: a Tutorial and Reference 
(www.petebecker.com/tr1book)
 




 4 Posts in Topic:
problem with a reverse iterator
brad <byte8bits@[EMAIL  2008-05-05 17:55:44 
Re: problem with a reverse iterator
"Victor Bazarov"  2008-05-05 18:00:34 
Re: problem with a reverse iterator
brad <byte8bits@[EMAIL  2008-05-05 18:21:52 
Re: problem with a reverse iterator
Pete Becker <pete@[EMA  2008-05-05 20:34:50 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Jul 8 23:57:38 CDT 2008.