wrote:
> Hi all,
>
> I'm new to C++, and I'm trying to add the last two digits of a number.
> for example, 1988 , 8+8=16 any idea on how to do that?
>
> thanks.
>
*checks date* nope, not september.
This sounds suspiciously like a homework question. We try not to do
people's homework on here, if we can. However, here's a hint:
Convert the number to a string and exctract the last two characters.
Convert them back to numbers and add them. Don't forget to check the
string first to make sure it's really a number.
Another hint:
http://www.parashift.com/c++-faq-lit...t.html#faq-5.2
Please to not take offence at the above post. I can assure you that none
was meant.
Welcome to the group; we all hope you stick around and grow to love C++
as we do.
Tiff
--
Chris M Soanes: Amateur Sailor, Windsurfer, Cyclist, Biker, Mechanic,
Welder, Snowboarder, Swimmer, Dog Owner, Real Ale Drinker; Professional
Geek.
Its not a saviour that we want, just somebody else to crucify! - NMA