Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 109,372 C++ Programmers for FREE! Ask your question and get quick answers from experts. There are 948 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



adhbooooooooooot error

 
Reply to this topicStart new topic

adhbooooooooooot error, error in stream code

rohitkp
post 19 Jul, 2008 - 09:40 AM
Post #1


New D.I.C Head

*
Joined: 19 Jul, 2008
Posts: 2

when
we accept an integer in any c++ compiler
and we enter a "ZERO" before the other numeric value, the compiler takes only zero...


for example
if we enter 008 , in a integer , logically 8 should be taken by the compiler but it takes 0.
so
can any one solve this.?

i would entertain only solutions which solve this problem keeping the data type as int or float and not converting it into a char....please beware,.
User is offlineProfile CardPM

Go to the top of the page


NickDMax
post 19 Jul, 2008 - 09:51 AM
Post #2


2B||!2B

Group Icon
Joined: 18 Feb, 2007
Posts: 2,756



Thanked 34 times

Dream Kudos: 525
My Contributions


Well your question does not make a great deal of sense to me so let me see if I can sort this out:

You seem to be talking about entering numbers into a "compiler" which seems to indicate that you are trying to write a bit of code like:

int A = 0008;

Now the problem with this is that C/C++ will view a number of the form 0ddd (where d is a digit) as an octal input.

Now the second portion of your program seems to indicate that you are taking in an input in your program (which means you misspoke about the"compiler" portion above).

So you are trying to use something like scanf or cin to input a value. But scanf and cin have no problem reading "00008" properly. So I guess I just don't understand your problem.
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 9/6/08 11:27PM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month