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 

Wert von int 374berpr374fenn ^

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





PostPosted: Wed Nov 12, 2003 8:06 pm    Post subject: Wert von int 374berpr374fenn ^ Reply with quote



Hy NG!

Ich habe folgende Frage bezüglich einer Variablen-Abfrage:

Ich lese in meinem Programm 2 Werte ein, und muß diese
Abfrage dann überprüfen, ob es Integer-Zahlen sind.
Gibts da in C++ eine Funktion?

lg, Michael

--
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
Kai Ruhnau
Guest





PostPosted: Wed Nov 12, 2003 8:40 pm    Post subject: Re: Wert von int 374berpr374fenn Reply with quote



Michael Pernkopf wrote:

Quote:
Hy NG!

Ich habe folgende Frage bezüglich einer Variablen-Abfrage:

Ich lese in meinem Programm 2 Werte ein, und muß diese
Abfrage dann überprüfen, ob es Integer-Zahlen sind.
Gibts da in C++ eine Funktion?

lg, Michael

#include <iostream>

int main()
{
int x1,x2;
if (!(std::cin>>x1))
std::cout<<"Fehler int 1n";
else if (!(std::cin>>x1))
std::cout<<"Fehler int 2n";
else
{
//x1 und x2 sind gültige int's
}
return 0;
}

Grüße
Kai

--
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
Kai Ruhnau
Guest





PostPosted: Thu Nov 13, 2003 5:58 am    Post subject: Re: Wert von int 374berpr374fenn Reply with quote



Kai Ruhnau wrote:

Quote:
Michael Pernkopf wrote:

Hy NG!

Ich habe folgende Frage bezüglich einer Variablen-Abfrage:

Ich lese in meinem Programm 2 Werte ein, und muß diese
Abfrage dann überprüfen, ob es Integer-Zahlen sind.
Gibts da in C++ eine Funktion?

lg, Michael

#include <iostream

int main()
{
int x1,x2;
if (!(std::cin>>x1))
std::cout<<"Fehler int 1n";
//else if (!(std::cin>>x1))
else if (!(std::cin>>x2)) //Hoppla...
std::cout<<"Fehler int 2n";
else
{
//x1 und x2 sind gültige int's
}
return 0;
}


Grüße
Kai

--
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
Michael Pernkopf
Guest





PostPosted: Thu Nov 13, 2003 1:02 pm    Post subject: Re: Wert von int 374berpr374fenn Reply with quote


Quote:

Michael Pernkopf wrote:


[...]

Quote:

#include <iostream

int main()
{
int x1,x2;
if (!(std::cin>>x1))
std::cout<<"Fehler int 1n";
//else if (!(std::cin>>x1))
else if (!(std::cin>>x2)) //Hoppla...
std::cout<<"Fehler int 2n";
else
{
//x1 und x2 sind gültige int's
}
return 0;
}

Ich hab das mal nachgebastelt, und es hat zum gewünschten Ergebnis geführt.
Danke für deine schnelle Antwort

lg, Michael

--
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.