<?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[Ein Problem]]></title><description><![CDATA[<p>Könnt ihr mir sagen welcher hier der unterschied ist:</p>
<p>#include &lt;iostream&gt;</p>
<p>int main()<br />
{<br />
std::cout &lt;&lt; &quot;Hello world!&quot; &lt;&lt; std::endl;<br />
return 0;<br />
}</p>
<p>und</p>
<p>#include &lt;iostream.h&gt;<br />
void main()<br />
{<br />
// Dies ist das Hello-World-Programm<br />
cout&lt;&lt;&quot;Hello, world!&quot;&lt;&lt;endl;<br />
};</p>
<p>Das erstere kann ich anwenden aber beim zweiten kommt eine Fehlermeldung obwohl ich es richtig von einem Tutorial abgeschrieben hab.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/148041/ein-problem</link><generator>RSS for Node</generator><lastBuildDate>Fri, 04 Sep 2026 14:09:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/148041.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 22 May 2006 19:11:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ein Problem on Mon, 22 May 2006 19:11:49 GMT]]></title><description><![CDATA[<p>Könnt ihr mir sagen welcher hier der unterschied ist:</p>
<p>#include &lt;iostream&gt;</p>
<p>int main()<br />
{<br />
std::cout &lt;&lt; &quot;Hello world!&quot; &lt;&lt; std::endl;<br />
return 0;<br />
}</p>
<p>und</p>
<p>#include &lt;iostream.h&gt;<br />
void main()<br />
{<br />
// Dies ist das Hello-World-Programm<br />
cout&lt;&lt;&quot;Hello, world!&quot;&lt;&lt;endl;<br />
};</p>
<p>Das erstere kann ich anwenden aber beim zweiten kommt eine Fehlermeldung obwohl ich es richtig von einem Tutorial abgeschrieben hab.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1063055</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1063055</guid><dc:creator><![CDATA[T4D3U5]]></dc:creator><pubDate>Mon, 22 May 2006 19:11:49 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Mon, 22 May 2006 19:15:07 GMT]]></title><description><![CDATA[<p>Das erstere ist Standard-Conform, das zweitere nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1063057</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1063057</guid><dc:creator><![CDATA[Jochen Kalmbach]]></dc:creator><pubDate>Mon, 22 May 2006 19:15:07 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Mon, 22 May 2006 19:14:41 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=18363" rel="nofollow">Jochen Kalmbach</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=58" rel="nofollow">C++/CLI mit .NET</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1063058</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1063058</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 22 May 2006 19:14:41 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Mon, 22 May 2006 19:21:45 GMT]]></title><description><![CDATA[<p>T4D3U5 schrieb:</p>
<blockquote>
<p>#include &lt;iostream.h&gt;</p>
</blockquote>
<p>Nicht standardkonform, muss &lt;iostream&gt; sein</p>
<blockquote>
<p>void main()<br />
{<br />
// Dies ist das Hello-World-Programm<br />
cout&lt;&lt;&quot;Hello, world!&quot;&lt;&lt;endl;<br />
};</p>
</blockquote>
<p>Das geht auch nur mit nem &quot;using namespace std&quot;, dann kann man das &quot;std::&quot; weglassen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1063061</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1063061</guid><dc:creator><![CDATA[bluecode]]></dc:creator><pubDate>Mon, 22 May 2006 19:21:45 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Mon, 22 May 2006 21:06:26 GMT]]></title><description><![CDATA[<p>Trotzdem sollte man die std:: Version verwenden, da alles globale im Normalfall böse ist <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="😃"
    /> . Desweiteren bieten die meisten IDEs Codevervollständigungen über std:: an, so das man weniger Syntaxfehler macht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1063128</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1063128</guid><dc:creator><![CDATA[Jens_König]]></dc:creator><pubDate>Mon, 22 May 2006 21:06:26 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Mon, 22 May 2006 23:00:44 GMT]]></title><description><![CDATA[<p>Jens_König schrieb:</p>
<blockquote>
<p>Trotzdem sollte man die std:: Version verwenden, da alles globale im Normalfall böse ist <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="😃"
    /> . Desweiteren bieten die meisten IDEs Codevervollständigungen über std:: an, so das man weniger Syntaxfehler macht.</p>
</blockquote>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1063158</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1063158</guid><dc:creator><![CDATA[Christoph K.]]></dc:creator><pubDate>Mon, 22 May 2006 23:00:44 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Tue, 23 May 2006 16:45:11 GMT]]></title><description><![CDATA[<p>ups</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1063670</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1063670</guid><dc:creator><![CDATA[T4D3U5]]></dc:creator><pubDate>Tue, 23 May 2006 16:45:11 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Tue, 23 May 2006 17:41:44 GMT]]></title><description><![CDATA[<p>Jens_König schrieb:</p>
<blockquote>
<p>Trotzdem sollte man die std:: Version verwenden, da alles globale im Normalfall böse ist <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="😃"
    /> . Desweiteren bieten die meisten IDEs Codevervollständigungen über std:: an, so das man weniger Syntaxfehler macht.</p>
</blockquote>
<p>using namespace sollte man in Header-Dateien unterlassen, in Implementierungsdateien ist das kein Problem. Da hast du also wohl was durcheinander gebracht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1063718</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1063718</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Tue, 23 May 2006 17:41:44 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Wed, 24 May 2006 06:24:47 GMT]]></title><description><![CDATA[<p>Ich finde, &quot;using namespace&quot; ist ein Fehlkonstrukt von C++. Im Header sollte man das aus gutem Grund unterlassen. Da muß ich voll qualifizierte Namen angeben. In der Implementierungsdatei dann nicht mehr? Ich bevorzuge den gleichen Programmierstiel in der Header- und Implementierungsdatei. Es ist doch nicht verkehrt, an der Stelle, wo man ein Symbol verwendet, auch anzugeben, wo es her kommt. Schaut euch mal folgenden Beispielcode an:</p>
<pre><code>#include &lt;header_a.h&gt;
#include &lt;header_b.h&gt;
#include &lt;header_c.h&gt;
#include &lt;header_d.h&gt;

using namespace a;  // importiere Symbole aus header_a.h
using namespace b;  // importiere Symbole aus header_b.h
using namespace c;  // importiere Symbole aus header_c.h
using namespace d;  // importiere Symbole aus header_d.h

int main()
{
  irgendeineFunktion();
}
</code></pre>
<p>Wo gehört denn jetzt irgendeineFunktion hin? In welchem Header finde ich die Definition? Klarer wird es one dieses &quot;using namespace&quot;:</p>
<pre><code>#include &lt;header_a.h&gt;
#include &lt;header_b.h&gt;
#include &lt;header_c.h&gt;
#include &lt;header_d.h&gt;

int main()
{
  c::irgendeineFunktion();
}
</code></pre>
<p>Jetzt sollte es klar sein, wo das zu finden ist. Es steigert einfach die Lesbarkeit.</p>
<p>Ein weiteres Argument ist, daß &quot;using namespace&quot; das ganze Konzept der Namespaces auflöst. Eigentlich ist der Namespace dazu gedacht, Namensräume zu trennen. Und mit &quot;using namespace&quot; vermische ich sie wieder <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /> Warum habe ich sie dann überhaupt getrennt? Warum ist die Standard-Bibliothek dann überhaupt in das Namespace std gewandert?</p>
<p>Gruß</p>
<p>Tntnet</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1063950</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1063950</guid><dc:creator><![CDATA[tntnet]]></dc:creator><pubDate>Wed, 24 May 2006 06:24:47 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Wed, 24 May 2006 07:41:05 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Übertreibs mal nicht. Ich finde das eigentlich ganz gut so mit den using namspace. Das spart doch viel Tipparbeit. Falls doch mal eine Mehrdeutigkeit auftreten sollte, kann man ja den Namespace trotzdem noch angeben. In deinem Beispiel</p>
<pre><code class="language-cpp">#include &lt;header_a.h&gt;
#include &lt;header_b.h&gt;
#include &lt;header_c.h&gt;
#include &lt;header_d.h&gt;

using namespace a;  // importiere Symbole aus header_a.h
using namespace b;  // importiere Symbole aus header_b.h
using namespace c;  // importiere Symbole aus header_c.h
using namespace d;  // importiere Symbole aus header_d.h

int main()
{
  c::irgendeineFunktion();
}
</code></pre>
<p>Geht doch auch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1063972</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1063972</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 24 May 2006 07:41:05 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Wed, 24 May 2006 07:49:39 GMT]]></title><description><![CDATA[<p>T4D3U5 schrieb:</p>
<blockquote>
<p>#include &lt;iostream.h&gt;<br />
void main()<br />
{<br />
// Dies ist das Hello-World-Programm<br />
cout&lt;&lt;&quot;Hello, world!&quot;&lt;&lt;endl;<br />
};</p>
</blockquote>
<p><em>void main()</em> ist auch nicht Conform, es muss entweder <em>int main()</em> oder *int main( int argc, char *<em>argv )</em> heissen.</p>
<p>grüße</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1063978</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1063978</guid><dc:creator><![CDATA[David_pb]]></dc:creator><pubDate>Wed, 24 May 2006 07:49:39 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Wed, 24 May 2006 08:51:14 GMT]]></title><description><![CDATA[<blockquote>
<p>Wo gehört denn jetzt irgendeineFunktion hin?</p>
</blockquote>
<p>Rechte Maustaste-&gt;Go To Declaration. Solange die Funktion für den Compiler eindeutig ist, ist sie das in der Regel auch für jede vernünftige Entwicklungsumgebung. Und es zwingt dich ja keiner mit Notepad zu entwickeln.</p>
<p>Mal davon abgesehen: eine cpp-Datei ist aus Sicht des Compilers eine geschlossene Einheit, die von allen anderen Übersetzungseinheiten unabhängig ist. Insofern ist es schlicht persönliche Geschmackssache/firmeninterne Konventionssache ob und wie man Namespaces in cpp-Dateien öffnet. Technische Vor-/Nachteile gibt es hier eigentlich nicht. Bei Headern hingegen gibt es handfeste Gründe gegen jede using-Direktive bzw. using-Deklaration.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064024</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064024</guid><dc:creator><![CDATA[HumeSikkins]]></dc:creator><pubDate>Wed, 24 May 2006 08:51:14 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Wed, 24 May 2006 10:30:53 GMT]]></title><description><![CDATA[<p>Braunstein schrieb:</p>
<blockquote>
<p>Hallo,</p>
<p>Übertreibs mal nicht. Ich finde das eigentlich ganz gut so mit den using namspace. Das spart doch viel Tipparbeit.</p>
</blockquote>
<p>Mit der Lesbarkeit kann man nicht übertreiben. Weniger Tipparbeit ist da keine Ausrede. Oder verwendest Du grundsätzlich Bezeichner mit maximal 2 Buchstaben? Das spart doch Tipparbeit. Und mit Leerraum sollte man dann auch noch sparsam umgehen. Die Leer- und Returntasten sind sowieso so strapaziert.</p>
<p>Tschuldigung - ich glaube jetzt habe ich mich ein wenig zu viel rein gesteigert. Ich habe mich nun mal irgendwann für diesen Stiel entschieden und finde, daß er sich sehr bewährt hat. Ich bekomme immer wieder Resonanz, daß mein Code trotz sparsamer Kommentare gut verständlich ist.</p>
<p>Du findest Beispiele für meinen Stil auf meiner Homepage <a href="http://www.tntnet.org/" rel="nofollow">http://www.tntnet.org/</a>.</p>
<p>Gruß</p>
<p>Tommi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064111</guid><dc:creator><![CDATA[tntnet]]></dc:creator><pubDate>Wed, 24 May 2006 10:30:53 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Wed, 24 May 2006 13:28:24 GMT]]></title><description><![CDATA[<p>Dagegen ist auch nichts zu sagen. Da hat eben jeder seinen eigenen Stil.<br />
Ich öffne ja auch nicht immer alle Namensräume, sondern nur die, dessen Funktionen bzw. Typen ich sehr häufig verwende (z.Bsp. std).<br />
Außerdem versuche ich eigentlich schon instinktiv das Überschreiben von im std deklarierten Bezeichnern zu vermeiden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064269</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064269</guid><dc:creator><![CDATA[Braunstein (ausgeloggt)]]></dc:creator><pubDate>Wed, 24 May 2006 13:28:24 GMT</pubDate></item><item><title><![CDATA[Reply to Ein Problem on Wed, 24 May 2006 14:18:34 GMT]]></title><description><![CDATA[<p>Sodela noch mal kurz von mir was.</p>
<p>Ich bevorzuge überall die std:: Version, da sie imho weniger Zeit in Anspruch nimmt. Durch die Codevervollständigung z.B. bei express, hab ich eine viel kürzerer Fehlersuchzeit.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1064312</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1064312</guid><dc:creator><![CDATA[Jens_König]]></dc:creator><pubDate>Wed, 24 May 2006 14:18:34 GMT</pubDate></item></channel></rss>