<?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[Namespace ...]]></title><description><![CDATA[<p>Ich such ne online erklärung für namespace, steht in meinem Cpp Buch nicht drinnen. (von Andree Willms). KIennt jemand vieleicht einen Link???</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/124552/namespace</link><generator>RSS for Node</generator><lastBuildDate>Mon, 24 Aug 2026 07:30:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/124552.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 28 Oct 2005 14:57:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Namespace ... on Fri, 28 Oct 2005 14:57:29 GMT]]></title><description><![CDATA[<p>Ich such ne online erklärung für namespace, steht in meinem Cpp Buch nicht drinnen. (von Andree Willms). KIennt jemand vieleicht einen Link???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/902853</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902853</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Fri, 28 Oct 2005 14:57:29 GMT</pubDate></item><item><title><![CDATA[Reply to Namespace ... on Fri, 28 Oct 2005 14:59:34 GMT]]></title><description><![CDATA[<p>Ja, aber nicht weitersagen, von dem darf keiner wissen: <a href="http://www.google.de" rel="nofollow">www.google.de</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/902854</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902854</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Fri, 28 Oct 2005 14:59:34 GMT</pubDate></item><item><title><![CDATA[Reply to Namespace ... on Fri, 28 Oct 2005 15:02:21 GMT]]></title><description><![CDATA[<p>googln is ja gut, ABER manchmal kennt man ja doch ein paar gute Seiten!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/902858</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902858</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Fri, 28 Oct 2005 15:02:21 GMT</pubDate></item><item><title><![CDATA[Reply to Namespace ... on Fri, 28 Oct 2005 15:56:21 GMT]]></title><description><![CDATA[<p>Tc++H schrieb:</p>
<blockquote>
<p>googln is ja gut, ABER manchmal kennt man ja doch ein paar gute Seiten!!</p>
</blockquote>
<p>He he, schon gut, war ja nicht böse gemeint. Dein Buch hat aber auch schon ein paar Jährchen aufm Buckel, oder?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/902898</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/902898</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Fri, 28 Oct 2005 15:56:21 GMT</pubDate></item><item><title><![CDATA[Reply to Namespace ... on Sat, 29 Oct 2005 07:24:25 GMT]]></title><description><![CDATA[<p>Ein Namespace ist einfach gesagt ein Ordnungssystem für Code.<br />
Damit kannst du Code in &quot;Schubladen&quot; stecken.</p>
<pre><code class="language-cpp">namespace aga {
  struct foo {
    int a;
    foo() : a(0) {}
  };
}

namespace gag {
  struct foo {
    int a;
    foo () : a(0) {};
  };
}

using aga::foo;
int main() {
  foo aga_foo;
  aga_foo.a = 14;

  gag::foo gag_foo;
  gag_foo.a =13;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/903193</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/903193</guid><dc:creator><![CDATA[hehejo]]></dc:creator><pubDate>Sat, 29 Oct 2005 07:24:25 GMT</pubDate></item><item><title><![CDATA[Reply to Namespace ... on Sat, 29 Oct 2005 07:50:09 GMT]]></title><description><![CDATA[<p>Naja, eine eher schlechte Beschreibung und wohl kaum primär um den Code zu &quot;ordnen&quot;. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_down"
      title=":-1:"
      alt="👎"
    /></p>
<p>Namespaces wurden eingeführt, damit man Namenskonflikte zwischen mehreren Entwicklern und deren Libraries verhindern kann.</p>
<p>Z.B. steckt die gesamte C++ Standard-Library im Namespace std. Wemm jemand eine Klasse string definiert, wird er nicht mit der string Klasse aus dem std-Namespace in Konflikt kommen. Ich könnte z.B. meine eigene string-Klasse in den Namespace Artchi stecken.</p>
<pre><code class="language-cpp">namespace artchi {
  class string {
  };
}
</code></pre>
<p>Ohne Namespaces würde man Namenskonflikte bekommen, wegen Doppeldeutischkeiten.</p>
<p>Die &quot;Ordnung&quot; im Projekt ist dann eher ein guter Nebeneffekt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/903196</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/903196</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Sat, 29 Oct 2005 07:50:09 GMT</pubDate></item><item><title><![CDATA[Reply to Namespace ... on Sat, 29 Oct 2005 08:41:52 GMT]]></title><description><![CDATA[<p>Genau das wollte ich durch mein Beispiel oben sagen ohne in tiefe Details zu gehen.<br />
Es gibt die Schublade std:: usw.</p>
<p>Anhand meines kleinen Codebeispieles habe ich doch gezeigt, wie zwei &quot;gleiche&quot; Structs in verschiedene Namespaces aufgeteilt sind und sich so eben <strong>nicht</strong> überschneiden.</p>
<p>Aber gut, ich hätte es mit std::string und hehejo::string machen sollen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/903215</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/903215</guid><dc:creator><![CDATA[hehejo]]></dc:creator><pubDate>Sat, 29 Oct 2005 08:41:52 GMT</pubDate></item><item><title><![CDATA[Reply to Namespace ... on Sun, 06 Nov 2005 12:17:36 GMT]]></title><description><![CDATA[<p>moinmoin,</p>
<p>wie ist denn die Handhabung von namespaces in einer headerdatei von einer klasse.</p>
<p>beispielsweise hab ich eine class.h und eine class.c. daß using namespace std dort absolut verboten ist, hab ich schon mitbekommen, aber sollte ich da überhaupt einen namespace reinschreiben, oder kommt man da ohne aus oder wie oder was <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> ?</p>
<p>gruß Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/909342</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/909342</guid><dc:creator><![CDATA[happyaura]]></dc:creator><pubDate>Sun, 06 Nov 2005 12:17:36 GMT</pubDate></item><item><title><![CDATA[Reply to Namespace ... on Sun, 06 Nov 2005 12:41:37 GMT]]></title><description><![CDATA[<p>Wenn du das hier meinst:</p>
<pre><code class="language-cpp">// h Datei
namespace xx
{
    class bla
    {
        public:
        bla();
    };
}

// C++ Datei

namespace xx
{
    bla::bla()
    {
         //...
    }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/909371</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/909371</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Sun, 06 Nov 2005 12:41:37 GMT</pubDate></item><item><title><![CDATA[Reply to Namespace ... on Sun, 06 Nov 2005 12:49:47 GMT]]></title><description><![CDATA[<p>ich meinte eher die frage, ob man einen namespace benutzen muß/soll oder ob man einfach ohne namespace in der datei programmieren kann. funktionieren tut es.<br />
wirkt sich der namespace auf die dateinen aus, in denen meine klasse eingebunden ist?</p>
<p>[cpp]// bla.h</p>
<p>{<br />
class bla<br />
{<br />
public:<br />
bla();<br />
};<br />
}</p>
<p>// bla.cpp</p>
<p>{<br />
bla::bla()<br />
{<br />
//...<br />
}<br />
}</p>
<p><a href="//main.cpp">//main.cpp</a></p>
<p>#include bla.h<br />
using namespace std</p>
<p>int main(void){</p>
<p>}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/909392</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/909392</guid><dc:creator><![CDATA[happyaura]]></dc:creator><pubDate>Sun, 06 Nov 2005 12:49:47 GMT</pubDate></item><item><title><![CDATA[Reply to Namespace ... on Sun, 06 Nov 2005 12:53:16 GMT]]></title><description><![CDATA[<p>So?</p>
<pre><code class="language-cpp">//foo.h
#include &lt;string&gt;
struct Foo {
  void bar(const std::string&amp;);
};
</code></pre>
<pre><code class="language-cpp">//foo.cpp
#include &quot;foo.h&quot;

using namespace std;

void Foo::bar(const string &amp;s) {

};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/909395</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/909395</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Sun, 06 Nov 2005 12:53:16 GMT</pubDate></item><item><title><![CDATA[Reply to Namespace ... on Sun, 06 Nov 2005 12:55:26 GMT]]></title><description><![CDATA[<p>Namespace ist auf keinem Fall ne Pflicht, aber in größeren Programmen, wo manche Klassen-, Variablen, Funktionsname mehrmals vorkommen empfielt es sich.</p>
<p>zb.</p>
<p>in der Headerdatei</p>
<pre><code class="language-cpp">namespace Physic
{
   const float a = 2.00f;
}

namespace Math
{
    const float a = 3465436.0f;
}
</code></pre>
<p>jetzt kannst du:</p>
<pre><code class="language-cpp">Math::a;
bzw.
Physic::a;
</code></pre>
<p>aufrufen --&gt; du kannst zwei Variablen mit gleichen Namen in einer Datei deklarieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/909396</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/909396</guid><dc:creator><![CDATA[Tc++H]]></dc:creator><pubDate>Sun, 06 Nov 2005 12:55:26 GMT</pubDate></item></channel></rss>