C++Talk.NET Forum Index C++Talk.NET
C++ language newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

leading zeros - wrong int

 
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (German)
View previous topic :: View next topic  
Author Message
r.magdeburg
Guest





PostPosted: Mon Dec 01, 2003 6:45 pm    Post subject: leading zeros - wrong int Reply with quote



//please tell me why...
//and give me a hint to solve the problem with leading zeros.

//snippet
#include <iostream.h>
#include <conio.h>
int main()
{
int zahl = 0;
cout << "Give me an int please: ";
cin >> zahl;
cout << "int = " << zahl < getch();
return 0;
}
//examples with leading zeros:
//input 0045 screen output 37
//input 0049 output 4
// 094 0
//and so on
//thank you

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de
Back to top
Kostka, Volkmar
Guest





PostPosted: Mon Dec 01, 2003 7:23 pm    Post subject: Re: leading zeros - wrong int Reply with quote




Hallo,

r.magdeburg wrote:

Quote:
//please tell me why...
//and give me a hint to solve the problem with leading zeros.

//snippet
#include <iostream.h
#include int main()
{
int zahl = 0;
cout << "Give me an int please: ";
cin >> zahl;
cout << "int = " << zahl < getch();
return 0;
}
//examples with leading zeros:
//input 0045 screen output 37
//input 0049 output 4
// 094 0
//and so on
//thank you


Zahlen mit fuehrenden Nullen werden als Zahlen mit der Basis 8
interpretiert.

MFG

Volkmar Kostka

--
de.comp.lang.iso-c++ - Moderation: mailto:voyager+mod (AT) bud (DOT) prima.de
FAQ: http://www.voyager.prima.de/cpp/ mailto:voyager+send-faq (AT) bud (DOT) prima.de

Back to top
Display posts from previous:   
Post new topic   Reply to topic    C++Talk.NET Forum Index -> C++ (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.