<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Exceptions | Oberklasse im catch]]></title><description><![CDATA[<p>Hallo</p>
<p>ist es möglich in einem catch-block einfach die Oberklasse anzugeben?</p>
<pre><code class="language-cpp">try  {
   doIt();
} catch (Exception1 e){
   e.message();
} catch (Exception2 e){
   e.message();
} catch (Exception3 e){
   e.message();
}
</code></pre>
<pre><code class="language-cpp">try  {
   doIt();
} catch (Exception e){
   e.message();
}
</code></pre>
<p>also ich bekomme Fehlermeldung.. muss man was bestimmtes beachten?</p>
<pre><code class="language-cpp">#ifndef EXCEPTION_H
#define EXCEPTION_H
class Exception{
public:
	virtual void message();
};

#endif /* PEXCEPTION_H_ */
</code></pre>
<pre><code class="language-cpp">#ifndef INDEX_OUT_OF_BOUNDS_EXCEPTION_INCLUDED
#define INDEX_OUT_OF_BOUNDS_EXCEPTION_INCLUDED

#include &lt;iostream&gt;
#include &quot;PException.h&quot;
class IndexOutOfBoundsException : public Exception{

private:
	int maxIndex;
	int actualIndex;
public:
	IndexOutOfBoundsException(int maxIndex, int actualIndex);
	void message();

};

#endif
</code></pre>
<p>Danke schon mal</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/267027/exceptions-oberklasse-im-catch</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Sep 2026 19:00:18 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/267027.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 May 2010 08:35:43 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Exceptions | Oberklasse im catch on Tue, 18 May 2010 08:35:43 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>ist es möglich in einem catch-block einfach die Oberklasse anzugeben?</p>
<pre><code class="language-cpp">try  {
   doIt();
} catch (Exception1 e){
   e.message();
} catch (Exception2 e){
   e.message();
} catch (Exception3 e){
   e.message();
}
</code></pre>
<pre><code class="language-cpp">try  {
   doIt();
} catch (Exception e){
   e.message();
}
</code></pre>
<p>also ich bekomme Fehlermeldung.. muss man was bestimmtes beachten?</p>
<pre><code class="language-cpp">#ifndef EXCEPTION_H
#define EXCEPTION_H
class Exception{
public:
	virtual void message();
};

#endif /* PEXCEPTION_H_ */
</code></pre>
<pre><code class="language-cpp">#ifndef INDEX_OUT_OF_BOUNDS_EXCEPTION_INCLUDED
#define INDEX_OUT_OF_BOUNDS_EXCEPTION_INCLUDED

#include &lt;iostream&gt;
#include &quot;PException.h&quot;
class IndexOutOfBoundsException : public Exception{

private:
	int maxIndex;
	int actualIndex;
public:
	IndexOutOfBoundsException(int maxIndex, int actualIndex);
	void message();

};

#endif
</code></pre>
<p>Danke schon mal</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1898819</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1898819</guid><dc:creator><![CDATA[Dit_]]></dc:creator><pubDate>Tue, 18 May 2010 08:35:43 GMT</pubDate></item><item><title><![CDATA[Reply to Exceptions | Oberklasse im catch on Tue, 18 May 2010 09:06:53 GMT]]></title><description><![CDATA[<p>Zuerst einmal solltest du sagen, was für eine Fehlermeldung du erhältst.</p>
<p>Aber versuche mal die Exception per Referenz zu fangen:</p>
<pre><code class="language-cpp">try
{
   doIt();
}
catch (Exception &amp;e)
{
   e.message();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1898850</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1898850</guid><dc:creator><![CDATA[Th69]]></dc:creator><pubDate>Tue, 18 May 2010 09:06:53 GMT</pubDate></item><item><title><![CDATA[Reply to Exceptions | Oberklasse im catch on Tue, 18 May 2010 09:28:15 GMT]]></title><description><![CDATA[<p>Dit_ schrieb:</p>
<blockquote>
<p>also ich bekomme Fehlermeldung..</p>
</blockquote>
<p>Es wäre gut, wenn du die Fehlermeldung nächstes Mal auch angeben könntest.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1898865</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1898865</guid><dc:creator><![CDATA[Nexus]]></dc:creator><pubDate>Tue, 18 May 2010 09:28:15 GMT</pubDate></item><item><title><![CDATA[Reply to Exceptions | Oberklasse im catch on Tue, 18 May 2010 09:34:14 GMT]]></title><description><![CDATA[<p>Dit_ schrieb:</p>
<blockquote>
<p>muss man was bestimmtes beachten?</p>
</blockquote>
<p>Ja. Exceptions möglichst per Referenz fangen, nicht per Value.<br />
Was noch fehlt kann man dir ohne die Fehlermeldung nicht sagen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1898870</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1898870</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Tue, 18 May 2010 09:34:14 GMT</pubDate></item></channel></rss>