<?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[Virtuelle Funktionen: Problem mit Programm aus Übungsbuch]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich habe das Buch &quot;C++ IT-Tutorial&quot; von Herbert Schildt. Hab nun ein Problem mit einem Programm.</p>
<p>Hier erst mal der Code:</p>
<pre><code class="language-cpp">// p10-16.cpp
// Mit virtuellen Funktionen und Polymorphie arbeiten.

#include &lt;iostream&gt;
#include &lt;cstring&gt;
using namespace std;

// Eine Klasse fuer zweidimensionale Objekte.
class TwoDShape {
  // Diese Elemente sind privat.
  double width;
  double height;

  // Ein Namensfeld hinzufuegen.
  char name[20];
public:

  // Standardkonstruktor
  TwoDShape() {
    width = height = 0.0;
    strcpy(name, &quot;unbekannt&quot;);
  }

  // Konstruktor fuer TwoDShape
  TwoDShape(double w, double h, char *n) {
    width = w;
    height = h;
    strcpy(name, n);
  }

  // Ein Objekt mit gleicher Breite und Hoehe konstruieren.
  TwoDShape(double x, char *n) {
    width = height = x;
    strcpy(name, n);
  }

  void showDim() {
    cout &lt;&lt; &quot;Breite und Hoehe sind &quot; &lt;&lt;
             width &lt;&lt; &quot; und &quot; &lt;&lt; height &lt;&lt; &quot;.\n&quot;;
  }

  // Zugriffsfunktionen
  double getWidth() { return width; }
  double getHeight() { return height; }
  void setWidth(double w) { width = w; }
  void setHeight(double h) { height = h; }
  char *getName() { return name; }

  // Die virtuelle Funktion area() zu TwoDShape hinzufuegen. 
  virtual double area() {  
    cout &lt;&lt; &quot;Fehler: area() muss ueberschrieben werden.\n&quot;; 
    return 0.0; 
  }  

};

// Triangle ist von TwoDShape abgeleitet.
class Triangle : public TwoDShape {
  char style[20]; // jetzt privat
public:

  /* Ein Standardkonstruktor. Er ruft automatisch 
     den Standardkonstruktor von TwoDShape auf. */
  Triangle() {
    strcpy(style, &quot;unbekannt&quot;);
  }

  // Konstruktor mit drei Parametern.
  Triangle(char *str, double w,
           double h) : TwoDShape(w, h, &quot;dreieckig&quot;) {
    strcpy(style, str);
  }

  // Ein gleichschenkliges Dreieck konstruieren.
  Triangle(double x) : TwoDShape(x, &quot;gleichschenklig&quot;) { 
    strcpy(style, &quot;gleichschenklig&quot;); 
  }

  // Dies ueberschreibt jetzt area() in TwoDShape.
  double area() {
    return getWidth() * getHeight() / 2;
  }

  void showStyle() {
    cout &lt;&lt; &quot;Das Dreieck ist &quot;&lt;&lt; style &lt;&lt; &quot;.\n&quot;;
  }
};

// Eine abgeleitete Klasse von TwoDShape fuer Rechtecke.
class Rectangle : public TwoDShape {
public:

  // Ein Rechteck konstruieren. 
  Rectangle(double w, double h) : 
    TwoDShape(w, h, &quot;rechteckig&quot;) { } 

  // Ein Quadrat konstruieren. 
  Rectangle(double x) : 
    TwoDShape(x, &quot;quadratisch&quot;) { } 

  bool isSquare() {
    if(getWidth() == getHeight()) return true;
    return false;
  }

  // Auch hier wird area() ueberschrieben.
  double area() {
    return getWidth() * getHeight();
  }
};

int main() {
  // Ein Array von Zeigern auf TwoDShape-Objekte deklarieren.
  TwoDShape *shapes[5];

  shapes[0] = &amp;Triangle(&quot;rechtwinklig&quot;, 8.0, 12.0); 
  shapes[1] = &amp;Rectangle(10); 
  shapes[2] = &amp;Rectangle(10, 4); 
  shapes[3] = &amp;Triangle(7.0); 
  shapes[4] = &amp;TwoDShape(10, 20, &quot;generisch&quot;);

  for(int i=0; i &lt; 5; i++) { 
    cout &lt;&lt; &quot;Das Objekt ist &quot; &lt;&lt;
            shapes[i]-&gt;getName() &lt;&lt; &quot;.\n&quot;; 

    cout &lt;&lt; &quot;Die Flaeche ist &quot; &lt;&lt; 
            shapes[i]-&gt;area() &lt;&lt; &quot;.\n&quot;; 

    cout &lt;&lt; &quot;\n&quot;;   
  } 

  return 0;
}
</code></pre>
<p>So laut Buch sollte dieses Programm folgenden Output erzeugen:</p>
<pre><code>Das Objekt ist dreieckig.
Die Flaeche ist 48.

Das Objekt ist quadratisch.
Die Flaeche ist 100.

Das Objekt ist rechteckig.
Die Flaeche ist 40.

Das Objekt ist gleichschenklig.
Die Flaeche ist 24.5.

Das Objekt ist generisch.
Fehler: area() muss ueberschrieben werden.
Die Flaeche ist 0.
</code></pre>
<p>Bei mir wird aber Folgendes ausgegeben:</p>
<pre><code>Das Objekt ist generisch.
Fehler: area() muss ueberschrieben werden.
Die Flaeche ist 0.

Das Objekt ist generisch.
Fehler: area() muss ueberschrieben werden.
Die Flaeche ist 0.

Das Objekt ist generisch.
Fehler: area() muss ueberschrieben werden.
Die Flaeche ist 0.

Das Objekt ist generisch.
Fehler: area() muss ueberschrieben werden.
Die Flaeche ist 0.

Das Objekt ist generisch.
Fehler: area() muss ueberschrieben werden.
Die Flaeche ist 0.
</code></pre>
<p>Hab das Programm mit zwei verschiedenen Compilern erstellt, mit dem von Dev-C++ und mit dem von Visual C++ 2005 Express Edition, bei beiden das selbe Ergebnis.</p>
<p>Dev-C++ bringt auch folgende Warnungen:</p>
<pre><code>116 16.cpp warning: taking address of temporary
117 16.cpp warning: taking address of temporary
118 16.cpp warning: taking address of temporary
119 16.cpp warning: taking address of temporary
120 16.cpp warning: taking address of temporary
</code></pre>
<p>Ich hoffe mir kann jemand sagen warum das Programm nicht so funktioniert wie im Buch beschrieben. Und mir folgenden Abschnitt mal ein bisschen genauer erklären, steh da noch ein wenig auf der Leitung.</p>
<pre><code class="language-cpp">shapes[0] = &amp;Triangle(&quot;rechtwinklig&quot;, 8.0, 12.0); 
  shapes[1] = &amp;Rectangle(10); 
  shapes[2] = &amp;Rectangle(10, 4); 
  shapes[3] = &amp;Triangle(7.0); 
  shapes[4] = &amp;TwoDShape(10, 20, &quot;generisch&quot;);
</code></pre>
<p>Ich wünsch euch noch einen schönen Sonntag.<br />
MfG<br />
Christian</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/149896/virtuelle-funktionen-problem-mit-programm-aus-übungsbuch</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 10:23:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/149896.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 Jun 2006 09:25:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Virtuelle Funktionen: Problem mit Programm aus Übungsbuch on Sun, 11 Jun 2006 09:25:28 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich habe das Buch &quot;C++ IT-Tutorial&quot; von Herbert Schildt. Hab nun ein Problem mit einem Programm.</p>
<p>Hier erst mal der Code:</p>
<pre><code class="language-cpp">// p10-16.cpp
// Mit virtuellen Funktionen und Polymorphie arbeiten.

#include &lt;iostream&gt;
#include &lt;cstring&gt;
using namespace std;

// Eine Klasse fuer zweidimensionale Objekte.
class TwoDShape {
  // Diese Elemente sind privat.
  double width;
  double height;

  // Ein Namensfeld hinzufuegen.
  char name[20];
public:

  // Standardkonstruktor
  TwoDShape() {
    width = height = 0.0;
    strcpy(name, &quot;unbekannt&quot;);
  }

  // Konstruktor fuer TwoDShape
  TwoDShape(double w, double h, char *n) {
    width = w;
    height = h;
    strcpy(name, n);
  }

  // Ein Objekt mit gleicher Breite und Hoehe konstruieren.
  TwoDShape(double x, char *n) {
    width = height = x;
    strcpy(name, n);
  }

  void showDim() {
    cout &lt;&lt; &quot;Breite und Hoehe sind &quot; &lt;&lt;
             width &lt;&lt; &quot; und &quot; &lt;&lt; height &lt;&lt; &quot;.\n&quot;;
  }

  // Zugriffsfunktionen
  double getWidth() { return width; }
  double getHeight() { return height; }
  void setWidth(double w) { width = w; }
  void setHeight(double h) { height = h; }
  char *getName() { return name; }

  // Die virtuelle Funktion area() zu TwoDShape hinzufuegen. 
  virtual double area() {  
    cout &lt;&lt; &quot;Fehler: area() muss ueberschrieben werden.\n&quot;; 
    return 0.0; 
  }  

};

// Triangle ist von TwoDShape abgeleitet.
class Triangle : public TwoDShape {
  char style[20]; // jetzt privat
public:

  /* Ein Standardkonstruktor. Er ruft automatisch 
     den Standardkonstruktor von TwoDShape auf. */
  Triangle() {
    strcpy(style, &quot;unbekannt&quot;);
  }

  // Konstruktor mit drei Parametern.
  Triangle(char *str, double w,
           double h) : TwoDShape(w, h, &quot;dreieckig&quot;) {
    strcpy(style, str);
  }

  // Ein gleichschenkliges Dreieck konstruieren.
  Triangle(double x) : TwoDShape(x, &quot;gleichschenklig&quot;) { 
    strcpy(style, &quot;gleichschenklig&quot;); 
  }

  // Dies ueberschreibt jetzt area() in TwoDShape.
  double area() {
    return getWidth() * getHeight() / 2;
  }

  void showStyle() {
    cout &lt;&lt; &quot;Das Dreieck ist &quot;&lt;&lt; style &lt;&lt; &quot;.\n&quot;;
  }
};

// Eine abgeleitete Klasse von TwoDShape fuer Rechtecke.
class Rectangle : public TwoDShape {
public:

  // Ein Rechteck konstruieren. 
  Rectangle(double w, double h) : 
    TwoDShape(w, h, &quot;rechteckig&quot;) { } 

  // Ein Quadrat konstruieren. 
  Rectangle(double x) : 
    TwoDShape(x, &quot;quadratisch&quot;) { } 

  bool isSquare() {
    if(getWidth() == getHeight()) return true;
    return false;
  }

  // Auch hier wird area() ueberschrieben.
  double area() {
    return getWidth() * getHeight();
  }
};

int main() {
  // Ein Array von Zeigern auf TwoDShape-Objekte deklarieren.
  TwoDShape *shapes[5];

  shapes[0] = &amp;Triangle(&quot;rechtwinklig&quot;, 8.0, 12.0); 
  shapes[1] = &amp;Rectangle(10); 
  shapes[2] = &amp;Rectangle(10, 4); 
  shapes[3] = &amp;Triangle(7.0); 
  shapes[4] = &amp;TwoDShape(10, 20, &quot;generisch&quot;);

  for(int i=0; i &lt; 5; i++) { 
    cout &lt;&lt; &quot;Das Objekt ist &quot; &lt;&lt;
            shapes[i]-&gt;getName() &lt;&lt; &quot;.\n&quot;; 

    cout &lt;&lt; &quot;Die Flaeche ist &quot; &lt;&lt; 
            shapes[i]-&gt;area() &lt;&lt; &quot;.\n&quot;; 

    cout &lt;&lt; &quot;\n&quot;;   
  } 

  return 0;
}
</code></pre>
<p>So laut Buch sollte dieses Programm folgenden Output erzeugen:</p>
<pre><code>Das Objekt ist dreieckig.
Die Flaeche ist 48.

Das Objekt ist quadratisch.
Die Flaeche ist 100.

Das Objekt ist rechteckig.
Die Flaeche ist 40.

Das Objekt ist gleichschenklig.
Die Flaeche ist 24.5.

Das Objekt ist generisch.
Fehler: area() muss ueberschrieben werden.
Die Flaeche ist 0.
</code></pre>
<p>Bei mir wird aber Folgendes ausgegeben:</p>
<pre><code>Das Objekt ist generisch.
Fehler: area() muss ueberschrieben werden.
Die Flaeche ist 0.

Das Objekt ist generisch.
Fehler: area() muss ueberschrieben werden.
Die Flaeche ist 0.

Das Objekt ist generisch.
Fehler: area() muss ueberschrieben werden.
Die Flaeche ist 0.

Das Objekt ist generisch.
Fehler: area() muss ueberschrieben werden.
Die Flaeche ist 0.

Das Objekt ist generisch.
Fehler: area() muss ueberschrieben werden.
Die Flaeche ist 0.
</code></pre>
<p>Hab das Programm mit zwei verschiedenen Compilern erstellt, mit dem von Dev-C++ und mit dem von Visual C++ 2005 Express Edition, bei beiden das selbe Ergebnis.</p>
<p>Dev-C++ bringt auch folgende Warnungen:</p>
<pre><code>116 16.cpp warning: taking address of temporary
117 16.cpp warning: taking address of temporary
118 16.cpp warning: taking address of temporary
119 16.cpp warning: taking address of temporary
120 16.cpp warning: taking address of temporary
</code></pre>
<p>Ich hoffe mir kann jemand sagen warum das Programm nicht so funktioniert wie im Buch beschrieben. Und mir folgenden Abschnitt mal ein bisschen genauer erklären, steh da noch ein wenig auf der Leitung.</p>
<pre><code class="language-cpp">shapes[0] = &amp;Triangle(&quot;rechtwinklig&quot;, 8.0, 12.0); 
  shapes[1] = &amp;Rectangle(10); 
  shapes[2] = &amp;Rectangle(10, 4); 
  shapes[3] = &amp;Triangle(7.0); 
  shapes[4] = &amp;TwoDShape(10, 20, &quot;generisch&quot;);
</code></pre>
<p>Ich wünsch euch noch einen schönen Sonntag.<br />
MfG<br />
Christian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1075452</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1075452</guid><dc:creator><![CDATA[Horus]]></dc:creator><pubDate>Sun, 11 Jun 2006 09:25:28 GMT</pubDate></item><item><title><![CDATA[Reply to Virtuelle Funktionen: Problem mit Programm aus Übungsbuch on Sun, 11 Jun 2006 10:04:33 GMT]]></title><description><![CDATA[<p>Kagerer schrieb:</p>
<blockquote>
<pre><code class="language-cpp">shapes[0] = &amp;Triangle(&quot;rechtwinklig&quot;, 8.0, 12.0); 
  shapes[1] = &amp;Rectangle(10); 
  shapes[2] = &amp;Rectangle(10, 4); 
  shapes[3] = &amp;Triangle(7.0); 
  shapes[4] = &amp;TwoDShape(10, 20, &quot;generisch&quot;);
</code></pre>
</blockquote>
<p>Wenn dies wirklich so im Buch steht, wirf es bitte weg, denn das ist einfach nur falsch.</p>
<p>Mit Triangle(&quot;rechtwinklig&quot;, 8.0, 12.0) erzeugst Du ein temporäres Objekt vom Typ Triangle. Davon holst Du dir mit &amp; die Adresse. Danach wird das temporäre Objekt zerstört. Die Adresse ist also ungültig. Alles weitere was mit shapes[0] passiert ist schon undefiniert.</p>
<p>So müsste es aussehen:</p>
<pre><code class="language-cpp">shapes[0] = new Triangle(.....);
</code></pre>
<p>Aber am Ende nicht vergessen:</p>
<pre><code class="language-cpp">delete shapes[0];
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1075475</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1075475</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Sun, 11 Jun 2006 10:04:33 GMT</pubDate></item><item><title><![CDATA[Reply to Virtuelle Funktionen: Problem mit Programm aus Übungsbuch on Sun, 11 Jun 2006 11:23:50 GMT]]></title><description><![CDATA[<p>Vielen Dank für deine schnelle Antwort.</p>
<p>So funktionierts und ja das steht wirklich so im Buch, hab auch den Qellcode von <a href="http://www.mitp.de/vmi/mitp/detail/pWert/0980/titel/C%2B%2B%20IT-Tutorial" rel="nofollow">http://www.mitp.de/vmi/mitp/detail/pWert/0980/titel/C%2B%2B%20IT-Tutorial</a> runtergeladen, steht da aber genauso.</p>
<p>Die Operatoren new und delete kenne ich noch gar nicht, die kommen erst im übernächsten Kapitel. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Gruß<br />
Christian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1075516</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1075516</guid><dc:creator><![CDATA[Horus]]></dc:creator><pubDate>Sun, 11 Jun 2006 11:23:50 GMT</pubDate></item><item><title><![CDATA[Reply to Virtuelle Funktionen: Problem mit Programm aus Übungsbuch on Sun, 11 Jun 2006 11:52:11 GMT]]></title><description><![CDATA[<p>So im nächsten Beispiel steht praktisch wieder derselbe Blödsinn.</p>
<pre><code class="language-cpp">int main() {
  // Ein Array von Zeigern auf TwoDShape-Objekte deklarieren.
  TwoDShape *shapes[4];

  shapes[0] = &amp;Triangle(&quot;rechtwinklig&quot;, 8.0, 12.0); 
  shapes[1] = &amp;Rectangle(10); 
  shapes[2] = &amp;Rectangle(10, 4); 
  shapes[3] = &amp;Triangle(7.0); 

  for(int i=0; i &lt; 4; i++) { 
    cout &lt;&lt; &quot;Das Objekt ist &quot; &lt;&lt;
            shapes[i]-&gt;getName() &lt;&lt; &quot;.\n&quot;; 

    cout &lt;&lt; &quot;Die Flaeche ist &quot; &lt;&lt;
            shapes[i]-&gt;area() &lt;&lt; &quot;.\n&quot;; 

    cout &lt;&lt; &quot;\n&quot;;   
  } 

  return 0;
}
</code></pre>
<p>Gut das ich jetzt weiß wie es richtig geht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1075548</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1075548</guid><dc:creator><![CDATA[Horus]]></dc:creator><pubDate>Sun, 11 Jun 2006 11:52:11 GMT</pubDate></item><item><title><![CDATA[Reply to Virtuelle Funktionen: Problem mit Programm aus Übungsbuch on Sun, 11 Jun 2006 12:53:49 GMT]]></title><description><![CDATA[<p>Warum nimmste nicht gleich ein anderes C++ Buch, wenn dieses derart Fehler enthält?<br />
Es gibt doch viele, gute andere Bücher noch.</p>
<p>Auf der Hauptseite hat es daher viele Buchempfehlungen. Schau dir das evtl. mal an. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1075593</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1075593</guid><dc:creator><![CDATA[ChrissiB]]></dc:creator><pubDate>Sun, 11 Jun 2006 12:53:49 GMT</pubDate></item><item><title><![CDATA[Reply to Virtuelle Funktionen: Problem mit Programm aus Übungsbuch on Sun, 11 Jun 2006 13:08:40 GMT]]></title><description><![CDATA[<p>Werd die letzten beiden Kapitel im Buch auch noch durchgehen. Waren ja die ersten groben fehler die mir aufgefallen sind. Hoffe gibt nicht noch mehr davon. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>MfG<br />
Christian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1075600</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1075600</guid><dc:creator><![CDATA[Horus]]></dc:creator><pubDate>Sun, 11 Jun 2006 13:08:40 GMT</pubDate></item><item><title><![CDATA[Reply to Virtuelle Funktionen: Problem mit Programm aus Übungsbuch on Sun, 11 Jun 2006 13:29:50 GMT]]></title><description><![CDATA[<p>Kagerer schrieb:</p>
<blockquote>
<pre><code class="language-cpp">shapes[0] = &amp;Triangle(&quot;rechtwinklig&quot;, 8.0, 12.0); 
  shapes[1] = &amp;Rectangle(10); 
  shapes[2] = &amp;Rectangle(10, 4); 
  shapes[3] = &amp;Triangle(7.0); 
  shapes[4] = &amp;TwoDShape(10, 20, &quot;generisch&quot;);
</code></pre>
</blockquote>
<p>an sich dürfte das nicht einmal compilieren, da der operator &amp; ein lvalue verlangt und kein memberoperator &amp; definiert wurde. aber bei solchen feinheiten haben einige compiler schwierigkeiten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1075602</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1075602</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sun, 11 Jun 2006 13:29:50 GMT</pubDate></item><item><title><![CDATA[Reply to Virtuelle Funktionen: Problem mit Programm aus Übungsbuch on Sun, 11 Jun 2006 15:29:14 GMT]]></title><description><![CDATA[<p>Also wie gesagt Dev-C++ und Visual C++ 2005 kompilieren es.</p>
<p>Dev-C++ bringt folgende Warnungen:</p>
<p>116 16.cpp warning: taking address of temporary<br />
117 16.cpp warning: taking address of temporary<br />
118 16.cpp warning: taking address of temporary<br />
119 16.cpp warning: taking address of temporary<br />
120 16.cpp warning: taking address of temporary</p>
<p>Visual C++ bringt nur 6x die Meldung das 'strcpy' veraltet ist und ich 'strcpy_s' verwenden soll.</p>
<p>Gruß<br />
Christian</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1075662</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1075662</guid><dc:creator><![CDATA[Horus]]></dc:creator><pubDate>Sun, 11 Jun 2006 15:29:14 GMT</pubDate></item><item><title><![CDATA[Reply to Virtuelle Funktionen: Problem mit Programm aus Übungsbuch on Sun, 11 Jun 2006 16:28:33 GMT]]></title><description><![CDATA[<p>stell ich visual c++ 2005 die spracherweiterungen ab, weist er das ganze korrekt zurück mit:<br />
(116) : error C2102: '&amp;' requires l-value</p>
<p>mit language-extensions on (dummerweise der standard, aber notwendig für windows header u.ä.), gibt es eine level 4 warnung<br />
(116) : warning C4238: nonstandard extension used : class rvalue used as lvalue</p>
<p>g++ hab ich gerade nicht zur hand, ich stell mir aber vor, dass da mit -pedantic oder -ansi etwas weniger harmloses als die erwähnte warnung geschiueht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1075695</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1075695</guid><dc:creator><![CDATA[camper]]></dc:creator><pubDate>Sun, 11 Jun 2006 16:28:33 GMT</pubDate></item></channel></rss>