<?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>Hallo, hoffe mir kann jemand helfen.</p>
<p>Habe folgenden Originalcode (mit Fehlern)</p>
<pre><code class="language-cpp"># include &lt;iostream &gt;
namespace test
{
using namespace std;
enum colors { rot , blau , gruen , schwarz };
int n;
namespace alpha
{

double x = 1.05;
}
}
namespace beta
{
using namespace test :: alpha ;
double f(int , double );
}
namespace test {
const int m = 0;
}
int main ( )
{
x = 12.5;
n = 1;
cout &lt;&lt; rot &lt;&lt; endl ;
alpha ::f(3, 2.0) ;
using namespace test ;
n = 2;
x = 2.02;
beta ::f(n, x);
beta ::f( beta ::m, x);
return 0;
}
</code></pre>
<p>Habe die Fehler, meiner Meinung nach, behoben.</p>
<pre><code class="language-cpp"># include &lt;iostream &gt;

namespace test
{
	using namespace std;
	enum colors { rot , blau , gruen , schwarz };
	int n;

	namespace alpha
	{
		double x = 1.05;
	}
}

namespace beta
{
	using namespace test::alpha;
	double f(int , double );
}

namespace test {
	const int m = 0;
}
int main ( )
{
	{
		using namespace test;
		using namespace alpha;
		x = 12.5;
		n =	1;
		cout &lt;&lt; rot &lt;&lt; endl;
	}

	{	
		using namespace beta;
		beta::f(3, 2.0) ;

	}

	{
		using namespace test;
		using namespace alpha;
		using namespace beta;
		n = 2;
		x = 2.02;
		beta ::f(n, x);
	}

	{

		using namespace beta;
		beta ::f( test::m, x );

		return 0;
	}
}
</code></pre>
<p>Allerdings wird mir angezeigt, dass es Fehler gibt.</p>
<p>error LNK2001: Nicht aufgelöstes externes Symbol &quot;_mainCRTStartup&quot;.</p>
<p>error LNK1120: 1 nicht aufgelöste externe Verweise.</p>
<p>Kann mir jemand helfen?</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/304704/namespace</link><generator>RSS for Node</generator><lastBuildDate>Wed, 24 Jun 2026 18:12:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/304704.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 12 Jun 2012 18:11:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Namespace on Tue, 12 Jun 2012 18:11:10 GMT]]></title><description><![CDATA[<p>Hallo, hoffe mir kann jemand helfen.</p>
<p>Habe folgenden Originalcode (mit Fehlern)</p>
<pre><code class="language-cpp"># include &lt;iostream &gt;
namespace test
{
using namespace std;
enum colors { rot , blau , gruen , schwarz };
int n;
namespace alpha
{

double x = 1.05;
}
}
namespace beta
{
using namespace test :: alpha ;
double f(int , double );
}
namespace test {
const int m = 0;
}
int main ( )
{
x = 12.5;
n = 1;
cout &lt;&lt; rot &lt;&lt; endl ;
alpha ::f(3, 2.0) ;
using namespace test ;
n = 2;
x = 2.02;
beta ::f(n, x);
beta ::f( beta ::m, x);
return 0;
}
</code></pre>
<p>Habe die Fehler, meiner Meinung nach, behoben.</p>
<pre><code class="language-cpp"># include &lt;iostream &gt;

namespace test
{
	using namespace std;
	enum colors { rot , blau , gruen , schwarz };
	int n;

	namespace alpha
	{
		double x = 1.05;
	}
}

namespace beta
{
	using namespace test::alpha;
	double f(int , double );
}

namespace test {
	const int m = 0;
}
int main ( )
{
	{
		using namespace test;
		using namespace alpha;
		x = 12.5;
		n =	1;
		cout &lt;&lt; rot &lt;&lt; endl;
	}

	{	
		using namespace beta;
		beta::f(3, 2.0) ;

	}

	{
		using namespace test;
		using namespace alpha;
		using namespace beta;
		n = 2;
		x = 2.02;
		beta ::f(n, x);
	}

	{

		using namespace beta;
		beta ::f( test::m, x );

		return 0;
	}
}
</code></pre>
<p>Allerdings wird mir angezeigt, dass es Fehler gibt.</p>
<p>error LNK2001: Nicht aufgelöstes externes Symbol &quot;_mainCRTStartup&quot;.</p>
<p>error LNK1120: 1 nicht aufgelöste externe Verweise.</p>
<p>Kann mir jemand helfen?</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2222485</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2222485</guid><dc:creator><![CDATA[KeinNameMehrFrei]]></dc:creator><pubDate>Tue, 12 Jun 2012 18:11:10 GMT</pubDate></item><item><title><![CDATA[Reply to Namespace on Tue, 12 Jun 2012 20:01:42 GMT]]></title><description><![CDATA[<p>Hast du als Projekttyp CLR-Konsolenanwendung genommen?<br />
Du willst Win32-Konsolenanwendung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2222528</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2222528</guid><dc:creator><![CDATA[IrgendeinName]]></dc:creator><pubDate>Tue, 12 Jun 2012 20:01:42 GMT</pubDate></item></channel></rss>