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 

Ungewollter Abbruch -- Floating Point Execption

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





PostPosted: Mon Mar 28, 2005 9:17 am    Post subject: Ungewollter Abbruch -- Floating Point Execption Reply with quote



Hallo,

Shared Library:

bool irgentwas(const char* k) {
cout << "irgentwas" << endl;
return true;
}

Aufrufer der Funktion:

int main() {
string x;
cin >> x;

const char* k = x.c_str();

bool ergebnis = irgentwas(k);
return 0;
}

Das Ganze lässt sich beides Prima kompilieren und ist soweit korrekt
gelinkt...

Gebe ich jedoch etwas ein bricht das Programm ab: Floating Point Exeption

gruß
Wilhelm Korrengk

--
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
Thomas Maeder
Guest





PostPosted: Mon Mar 28, 2005 1:37 pm    Post subject: Re: Ungewollter Abbruch -- Floating Point Execption Reply with quote



"Wilhelm K." <DerBadejunge (AT) web (DOT) de> writes:

Quote:
bool irgentwas(const char* k) {
cout << "irgentwas" << endl;
return true;
}

Aufrufer der Funktion:

int main() {
string x;
cin >> x;

const char* k = x.c_str();

Hmm. Before der Wert von x gelesen wird, solltest Du überprüfen, ob
die Eingabe geklappt hat. In diesem Fall hat das Programm zwar
definiertes Verhalten, aber möglicherweise unerwartetes.


Quote:
bool ergebnis = irgentwas(k);
return 0;
}

Das Ganze lässt sich beides Prima kompilieren und ist soweit korrekt
gelinkt...

Gebe ich jedoch etwas ein bricht das Programm ab: Floating Point Exeption

Irgend etwas ist falsch. :-)

Kannst Du den Fehler auch ohne "Shared Library" reproduzieren? Shared
Libraries sind nämlich ausserhalb des Bereichs von ISO C++. Wenn
nicht, würde ich eher beim Hersteller der C++-Implementierung
nachfragen.

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