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 

Variablendeklaration

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





PostPosted: Mon Jun 14, 2004 1:19 pm    Post subject: Variablendeklaration Reply with quote



Hallo,

habe wenig Ahnung von C++, muss hier aber ein kleines Programm
kompilieren, bei dem die korrekte Deklaration einer Variabelen fehlt.
Folgender Ausschnitt:
try {
[tue eine ganze Menge...]
}
catch (const QString& str) {
[was anderes machen...]
}

Wie muss ich "str" deklarieren, damit ich das Programm erfolgreich
kompilieren kann? Ist der Ausschnitt ausreichend, um meine Frage zu
beantworten?

Danke

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
Hendrik Belitz
Guest





PostPosted: Mon Jun 14, 2004 2:17 pm    Post subject: Re: Variablendeklaration Reply with quote



Michael Kirchner wrote:

Quote:
Hallo,

habe wenig Ahnung von C++, muss hier aber ein kleines Programm
kompilieren, bei dem die korrekte Deklaration einer Variabelen fehlt.
Folgender Ausschnitt:
try {
[tue eine ganze Menge...]
}
catch (const QString& str) {
[was anderes machen...]
}

Wie muss ich "str" deklarieren, damit ich das Programm erfolgreich
kompilieren kann?

Garnicht, vorausgesetzt, der Typ QString existiert überhaupt. Da ich
annehme, daß Du Dich hier auf die Qt-Library beziehst, mußt Du
sicherstellen,daß Du auch qstring.h inkludiert hast.

--
To get my real email adress, remove the two onkas
--
Hendrik Belitz
- Abort, Retry, Fthagn? -

--
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
Rolf Magnus
Guest





PostPosted: Mon Jun 14, 2004 4:02 pm    Post subject: Re: Variablendeklaration Reply with quote



Michael Kirchner wrote:

Quote:
Hallo,

habe wenig Ahnung von C++, muss hier aber ein kleines Programm
kompilieren, bei dem die korrekte Deklaration einer Variabelen fehlt.

Und woraus schließt du das?

Quote:
Folgender Ausschnitt:
try {
[tue eine ganze Menge...]
}
catch (const QString& str) {
[was anderes machen...]
}

Wie muss ich "str" deklarieren, damit ich das Programm erfolgreich
kompilieren kann?

So wie du es oben machst, sofern QString definiert ist. Aber bist du
sicher, daß du einen String werfen willst?

Quote:
Ist der Ausschnitt ausreichend, um meine Frage zu beantworten?

Nein.

--
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 Kirchner
Guest





PostPosted: Tue Jun 15, 2004 7:07 am    Post subject: Re: Variablendeklaration - Lösung Reply with quote

Rolf Magnus schrieb:
Quote:
Michael Kirchner wrote:


Hallo,

habe wenig Ahnung von C++, muss hier aber ein kleines Programm
kompilieren, bei dem die korrekte Deklaration einer Variabelen fehlt.

Und woraus schließt du das?

Der Compiler beschwert sich....

Quote:

Folgender Ausschnitt:
try {
[tue eine ganze Menge...]
}
catch (const QString& str) {
[was anderes machen...]
}

Wie muss ich "str" deklarieren, damit ich das Programm erfolgreich
kompilieren kann?

So wie du es oben machst, sofern QString definiert ist. Aber bist du
sicher, daß du einen String werfen willst?

Ist der Ausschnitt ausreichend, um meine Frage zu beantworten?

Nein.

Ist nicht so einfach, den umfangreichen Quelltext gut zu kürzen.

Jedenfalls habe ich jetzt eine Lösung gefunden. Meine QT-Version war zu
neu. habe jetzt eine etwas ältere installiert, nun funktioniert's, auch
ohne Änderungen am Quelltext.
Danke auch an Hendrik für den Tipp, dass es eigentlich definiert sein
müsste.

Gruß
Micha

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