<?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[getline-Problem]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich wollte eigentlich nur eine Funktion erstellen, die auch Leerzeichen in einem String auswertet. Eigentlich wird nur die Funktion getline aufgerufen.<br />
Ich will aber nicht immer</p>
<pre><code>getline (cin,VARIABLE);
</code></pre>
<p>eingeben, sondern</p>
<pre><code>in VARIABLE;
</code></pre>
<p>, was das gleiche Ergebnis erzielt.</p>
<p>Das komplette Programm mit der Funktion (namens &quot;in&quot;) sieht so aus:</p>
<pre><code>/* Header-Dateien inkludieren */

#include &lt;iostream&gt;
#include &lt;math.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;windows.h&gt;
using namespace std;

/* allgemeine Variablen deklarieren und definieren */

#define container struct
#define out cout&lt;&lt;
typedef short int INT16;	// 16 Bit
typedef int INT32;		// 32 Bit
typedef long long int INT64;	// 64 Bit
typedef string STR32;	// 32 Bit

/* programmspezifische Variablen deklarieren. */

container data {
	STR32 test0;
} data;

/* Programmcode */

void clear () {
	system (&quot;cls&quot;);
};
void in (STR32 x) {
	getline (cin,x);
};
void pause () {
	system (&quot;pause &gt; NUL&quot;);
};
void sleep (INT32 msec) {
	Sleep (msec);
};
INT32 main () {
	in data.test0;
	out data.test0;
	pause();
	return 0;
};
</code></pre>
<p>Warum meckert hier der Compiler mit folgendem Text:</p>
<ul>
<li></li>
</ul>
<p>TEST.cpp: In function 'INT32 main()':<br />
TEST.cpp:45:5: error: expected ';' before 'data'<br />
*</p>
<p>Danke im Voraus!</p>
<p>Seikuassi</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/317246/getline-problem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 29 Jul 2026 01:19:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/317246.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 01 Jun 2013 15:13:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to getline-Problem on Sat, 01 Jun 2013 15:13:00 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich wollte eigentlich nur eine Funktion erstellen, die auch Leerzeichen in einem String auswertet. Eigentlich wird nur die Funktion getline aufgerufen.<br />
Ich will aber nicht immer</p>
<pre><code>getline (cin,VARIABLE);
</code></pre>
<p>eingeben, sondern</p>
<pre><code>in VARIABLE;
</code></pre>
<p>, was das gleiche Ergebnis erzielt.</p>
<p>Das komplette Programm mit der Funktion (namens &quot;in&quot;) sieht so aus:</p>
<pre><code>/* Header-Dateien inkludieren */

#include &lt;iostream&gt;
#include &lt;math.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;windows.h&gt;
using namespace std;

/* allgemeine Variablen deklarieren und definieren */

#define container struct
#define out cout&lt;&lt;
typedef short int INT16;	// 16 Bit
typedef int INT32;		// 32 Bit
typedef long long int INT64;	// 64 Bit
typedef string STR32;	// 32 Bit

/* programmspezifische Variablen deklarieren. */

container data {
	STR32 test0;
} data;

/* Programmcode */

void clear () {
	system (&quot;cls&quot;);
};
void in (STR32 x) {
	getline (cin,x);
};
void pause () {
	system (&quot;pause &gt; NUL&quot;);
};
void sleep (INT32 msec) {
	Sleep (msec);
};
INT32 main () {
	in data.test0;
	out data.test0;
	pause();
	return 0;
};
</code></pre>
<p>Warum meckert hier der Compiler mit folgendem Text:</p>
<ul>
<li></li>
</ul>
<p>TEST.cpp: In function 'INT32 main()':<br />
TEST.cpp:45:5: error: expected ';' before 'data'<br />
*</p>
<p>Danke im Voraus!</p>
<p>Seikuassi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2327817</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2327817</guid><dc:creator><![CDATA[Seikuassi]]></dc:creator><pubDate>Sat, 01 Jun 2013 15:13:00 GMT</pubDate></item><item><title><![CDATA[Reply to getline-Problem on Sat, 01 Jun 2013 15:55:58 GMT]]></title><description><![CDATA[<p>Von welcher Programmiersprache zum Teufel kommst du? oO</p>
<p>Seikuassi schrieb:</p>
<blockquote>
<p>ich wollte eigentlich nur eine Funktion erstellen, die auch Leerzeichen in einem String auswertet. Eigentlich wird nur die Funktion getline aufgerufen.<br />
Ich will aber nicht immer</p>
<pre><code>getline (cin,VARIABLE);
</code></pre>
<p>eingeben, sondern</p>
<pre><code>in VARIABLE;
</code></pre>
<p>, was das gleiche Ergebnis erzielt.</p>
</blockquote>
<p><strong>Wieso?</strong> Was hast du davon? Keiner kann dann deinen Code lesen, oder weiß was da passiert ohne vorher alle komischen Makros auswendig zu lernen.<br />
Außerdem sind Makros mit kurzen Namen ziemlich &quot;gefährlich&quot;. Stell dir vor, du deklarierst eine Variable mit Namen in, was denkst du was der Compiler dir da für eine völlig komische Fehlermeldung geben kann.<br />
Edit: Ok, ich nehme jetzt gerade an, <code>in</code> sollte irgendwie ein Makro werden.</p>
<pre><code>#include &lt;math.h&gt;
#include &lt;stdlib.h&gt;
</code></pre>
<p>Bitte die C++-Versionen der C-Header einbinden: <code>&lt;cmath&gt;</code> und <code>&lt;cstdlib&gt;</code> .</p>
<p>Die Makros sind nutzlos.</p>
<pre><code>#define container struct // Nein! Wieso? Was soll das? Wem bringt das was?
#define out cout&lt;&lt;       // Ok, das haben wir alle mal gemacht. :D
</code></pre>
<blockquote>
<pre><code>typedef short int INT16;	// 16 Bit
typedef int INT32;		// 32 Bit
typedef long long int INT64;	// 64 Bit
typedef string STR32;	// 32 Bit
</code></pre>
</blockquote>
<p>Und die hier sind alle falsch. Statt <code>INT16</code> zu benutzen, binde <code>&lt;cstdint&gt;</code> ein und nutze <code>int16_t</code> , dasselbe für alle anderen Typedefs - außer dem auf String, was soll das werden?<br />
32-Bit char-Typen gibt es erst seit C++11, und auch da muss man tierisch vorsichtig sein weil die noch ziemlich nutzlos sind (außer man benutzt bestimmte facets).</p>
<blockquote>
<p>Warum meckert hier der Compiler mit folgendem Text:</p>
</blockquote>
<p>Weil man in C++ Funktionen anders aufruft, wie du sicher weißt. Mit zwei runden Klammern ( und ), in denen optional (je nach Funktionssignatur) noch Argumente für die Parameter stehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2327820</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2327820</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sat, 01 Jun 2013 15:55:58 GMT</pubDate></item><item><title><![CDATA[Reply to getline-Problem on Sat, 01 Jun 2013 19:17:37 GMT]]></title><description><![CDATA[<pre><code>INT32 main () {
    in data.test0;
    out data.test0;
    pause();
    return 0;
};
</code></pre>
<p>Das sieht noch zu sehr nach C++ aus. Erst mal die Klammern um den Funktionsrumpf weg.</p>
<pre><code>#define BEGIN {
#define END }

INT32 main ()
BEGIN
    in data.test0;
    out data.test0;
    pause();
    return 0;
END
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2327868</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2327868</guid><dc:creator><![CDATA[Ethon]]></dc:creator><pubDate>Sat, 01 Jun 2013 19:17:37 GMT</pubDate></item><item><title><![CDATA[Reply to getline-Problem on Sat, 01 Jun 2013 19:55:31 GMT]]></title><description><![CDATA[<blockquote>
<p>#define container struct // Nein! Wieso? Was soll das? Wem bringt das was?</p>
</blockquote>
<p>Das bringt keinem 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>Ich habe allerdings nochmal eine andere Frage: Warum kann man einen</p>
<pre><code>const char *
</code></pre>
<p>ändern (s.Code)?</p>
<pre><code>/* Header-Dateien inkludieren */

#include &lt;iostream&gt;
#include &lt;math.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;windows.h&gt;
using namespace std;

/* allgemeine Variablen deklarieren und definieren */

#define container struct
#define out cout&lt;&lt;
typedef short int INT16;	// 16 Bit
typedef int INT32;		// 32 Bit
typedef long long int INT64;	// 64 Bit
typedef const char* STR8;	// 8 Bit

/* programmspezifische Variablen deklarieren. */

container data {
	STR8 x0;
} data;

/* Programmcode */

void clear () {
	system (&quot;cls&quot;);
};
void pause () {
	system (&quot;pause &gt; NUL&quot;);
};
void sleep (INT32 msec) {
	Sleep (msec);
};
INT32 main () {
	data.x0 = &quot;Hallo!&quot;;
	out (data.x0);
	data.x0 = &quot;Ballo!&quot;;
	out (data.x0);
	pause();
	return 0;
};
</code></pre>
<blockquote>
<p>Bitte die C++-Versionen der C-Header einbinden: &lt;cmath&gt; und &lt;cstdlib&gt;.</p>
</blockquote>
<p>Würde ich gerne machen, aber scheinbar habe ich diese Bibliotheken nicht. Ich benutze MinGW32 g++.exe Version 4.7.x. Vielleicht fehlt diese...</p>
<p>Danke im Voraus!</p>
<p>Seikuassi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2327877</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2327877</guid><dc:creator><![CDATA[Seikuassi]]></dc:creator><pubDate>Sat, 01 Jun 2013 19:55:31 GMT</pubDate></item><item><title><![CDATA[Reply to getline-Problem on Sat, 01 Jun 2013 20:12:43 GMT]]></title><description><![CDATA[<p>Ach, hätten wir bloß <strong>Whitespace-Overloading</strong>... :träum: (Pst: danke Volkard!)</p>
<p>Und dann weiter:</p>
<pre><code>INT32 main ()
??&lt;
    IN data.test0;
    OUT data.test0;
    PAUSE
??&gt;
</code></pre>
<p>Und das ganze kompiliert mit den richtigen Mitteln sogar:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;cstdint&gt;

typedef int32_t INT32;

struct IN
{
    template&lt;typename T&gt;
    IN( T&amp;&amp; t )
    {
        std::cin &gt;&gt; std::forward&lt;T&gt;(t); // Ich hab keine Ahnung, wieso ich perfect forwarding benutze. Keine.
    }
};

struct OUT
{
    template&lt;typename T&gt;
    OUT( T&amp;&amp; t )
    {
        std::cout &lt;&lt; std::forward&lt;T&gt;(t);
    }
};

#define IN (IN)
#define OUT (OUT)

INT32 main()
??&lt;
    INT32 A;
    IN A; // Wahnsinnig idiomatisch. Volkard wäre stolz auf mich.
    OUT A;
??&gt;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2327883</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2327883</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sat, 01 Jun 2013 20:12:43 GMT</pubDate></item><item><title><![CDATA[Reply to getline-Problem on Sat, 01 Jun 2013 20:28:49 GMT]]></title><description><![CDATA[<p>Hätte nicht gedacht, dass man sich so schnell in einem Forum unbeliebt machen kann... <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="😞"
    /> Tut mir Leid deswegen.</p>
<p>Also gut, hier ein &quot;normaler lesbarer&quot; Code. Und noch mal die Frage: Warum kann man einen</p>
<pre><code>const char*
</code></pre>
<p>verändern?</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;math.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;windows.h&gt;
using namespace std;

int main () {
	const char* x0;
	x0 = &quot;Hallo0!&quot;;
	cout &lt;&lt; x0;
	x0 = &quot;Hallo1!&quot;;
	cout &lt;&lt; x0;
	system (&quot;pause &gt; NUL&quot;);
	return 0;
};
</code></pre>
<p>Danke im Voraus!</p>
<p>Seikuassi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2327891</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2327891</guid><dc:creator><![CDATA[Seikuassi]]></dc:creator><pubDate>Sat, 01 Jun 2013 20:28:49 GMT</pubDate></item><item><title><![CDATA[Reply to getline-Problem on Sat, 01 Jun 2013 20:39:54 GMT]]></title><description><![CDATA[<p>Ach, das war doch nur Gescherzle, nimm mich nicht ernst.</p>
<p>Übrigens, dein Code funktioniert, weil das const sich auf den Pointee (sprich: Auf das Objekt auf das der Zeiger zeigt) bezieht, und nicht auf den Zeiger. Ob du den Wert den der Zeiger beinhaltet ändern kannst, oder den Wert auf den der Zeiger zeigt, das bestimmt die genaue Qualifizierung und ob der cv-qualifier vor oder nach dem * kommt:</p>
<pre><code>int const * ptr; // Der Zeiger ist variabel, der Pointee ist unveränderbar
int * const ptr2; // Der Zeiger ist konstant, der Pointee ist veränderbar - gibt übrigens einen Compilerfehler (keine Initialisierung bei konstantem Objekt), da sieht man es auch nochmal, worauf sich das const bezieht
int const * const ptr3; // Du darfst raten
</code></pre>
<p>Siehe auch <a href="http://www.c-plusplus.net/forum/308634-full" rel="nofollow">hier</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2327893</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2327893</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sat, 01 Jun 2013 20:39:54 GMT</pubDate></item><item><title><![CDATA[Reply to getline-Problem on Sat, 01 Jun 2013 22:18:08 GMT]]></title><description><![CDATA[<blockquote>
<p>Ach, das war doch nur Gescherzle, nimm mich nicht ernst.</p>
</blockquote>
<p>Danke!</p>
<pre><code>int const * ptr; // Der Zeiger ist variabel, der Pointee ist unveränderbar
</code></pre>
<p>Beim</p>
<pre><code>const char *
</code></pre>
<p>funktioniert das. Warum gibt der Compiler aber ein Fehler aus, wenn ich</p>
<pre><code>const int * x = 39;
cout &lt;&lt; x;
</code></pre>
<p>schreibe?</p>
<pre><code>const char * x =&quot;39&quot;;
cout &lt;&lt; x;
</code></pre>
<p>würde aber gehen. Warum ist das denn jetzt so?<br />
Der Fehler vom oberen Code sieht so aus:</p>
<p>**<br />
TEST.cpp: In function 'INT32 main()':<br />
TEST.cpp:43:19: error: invalid conversion from 'int' to 'const int*' [-fpermissive]<br />
**</p>
<p>Danke im Voraus!</p>
<p>Seikuassi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2327901</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2327901</guid><dc:creator><![CDATA[Seikuassi]]></dc:creator><pubDate>Sat, 01 Jun 2013 22:18:08 GMT</pubDate></item><item><title><![CDATA[Reply to getline-Problem on Sat, 01 Jun 2013 22:34:07 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Ach, hätten wir bloß <strong>Whitespace-Overloading</strong>... :träum: (Pst: danke Volkard!)</p>
</blockquote>
<p>Ach, du meinst wahrscheinlich lexical operator overloading aus C++27.</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;operator&gt; //für std::prefix, std::postfix
#include &lt;singleton&gt;

struct out &lsqb;&lsqb;std::singleton&rsqb;&rsqb;
{
	template &lt;class T&gt;
	this &amp;operator ' ' (T const &amp;value) const
	{
		std::cout &lt;&lt; value;
	}
};

struct lexical_operators_demo
{
	this &amp;operator ' ' () const
	{
		out 'h';
	}

	this &amp;operator ' ' (std::prefix) const
	{
		out 'e';
	}

	this &amp;operator '\t' () const
	{
		out 'l';
	}

	this &amp;operator '\t' (std::prefix) const
	{
		out 'o';
	}

	this &amp;operator '\n' () const
	{
		out '\n';
	}

	this &amp;operator '(' (std::prefix) const {}
	this &amp;operator ')' (std::postfix) const {}

	void operator ';' (std::postfix) const {}
};

int main(std::initializer_list&lt;std::string&gt;)
{
	(	(( (lexical_operators_demo{} ))		)
);
}
</code></pre>
<p>(Das Beispiel erfordert GCC 11.2 oder Clang 3.56 mit der Option --std=c++2z.)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2327904</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2327904</guid><dc:creator><![CDATA[TyRoXx]]></dc:creator><pubDate>Sat, 01 Jun 2013 22:34:07 GMT</pubDate></item><item><title><![CDATA[Reply to getline-Problem on Sat, 01 Jun 2013 23:06:31 GMT]]></title><description><![CDATA[<blockquote>
<pre><code>&lsqb;&lsqb;std::singleton&rsqb;&rsqb;
</code></pre>
</blockquote>
<p>Was zum Teufel soll denn das sein? oO<br />
Attribute sollen nicht so einen Quark machen. Die legen nur die Threading-Policy fest, die dann vom Compiler automatisch ergänzt wird.</p>
<p>Und deine Funktionen haben kein <code>return</code> -Statement - aber warte, das wird in C++32 gefixt. Referenzen auf <code>this</code> werden natürlich automatisch zurückgegeben.</p>
<p>Das wird zeitgleich mit <em>variadic variadic templates</em> eingeführt, mit denen man endlich die bis dahin fehlende Generizität in seinem Code hat. Wer wollte nicht schon mal beliebig viele <em>template parameter packs</em> haben? Wie sonst soll man bei partieller Spezialisierung eines Klassentemplates mit <em>template parameter pack</em> generisch bleiben?</p>
<p>Schade nur, dass sich keiner mehr für C++ interessiert. D ist der Renner. :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2327908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2327908</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sat, 01 Jun 2013 23:06:31 GMT</pubDate></item><item><title><![CDATA[Reply to getline-Problem on Sat, 01 Jun 2013 23:33:06 GMT]]></title><description><![CDATA[<p>Sone schrieb:</p>
<blockquote>
<p>Und deine Funktionen haben kein <code>return</code> -Statement - aber warte, das wird in C++32 gefixt. Referenzen auf <code>this</code> werden natürlich automatisch zurückgegeben.</p>
</blockquote>
<p>Du benutzt wahrscheinlich Visual C++. Microsoft hat das automatische <code>return</code> noch nicht implementiert. Versuch mal GCC oder <em>den neuen</em> Clang.</p>
<p>Sone schrieb:</p>
<blockquote>
<p>Das wird zeitgleich mit <em>variadic variadic templates</em> eingeführt, mit denen man endlich die bis dahin fehlende Generizität in seinem Code hat. Wer wollte nicht schon mal beliebig viele <em>template parameter packs</em> haben? Wie sonst soll man bei partieller Spezialisierung eines Klassentemplates mit <em>template parameter pack</em> generisch bleiben?</p>
</blockquote>
<pre><code class="language-cpp">#include &lt;cstdint&gt;
#include &lt;algorithm&gt;

//neue &quot;uniform parameterization syntax&quot; und variadic variadic template
template {class ...Args1, ...{any ...Args2}}
class A;

//neue Typen
using B{A{{std::uint512_t}, {tribool, &lt;html&gt;&lt;body&gt;Hello, world!&lt;/body&gt;&lt;/html&gt;}}};

//Argument-Packs sind jetzt endlich richtige Ranges
template {class ...Args}
using C{A{
	std::sort{
		std::next{std::begin{Args}, 2},
		std::end{Args}
	}}};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2327909</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2327909</guid><dc:creator><![CDATA[TyRoXx]]></dc:creator><pubDate>Sat, 01 Jun 2013 23:33:06 GMT</pubDate></item><item><title><![CDATA[Reply to getline-Problem on Sun, 02 Jun 2013 08:13:36 GMT]]></title><description><![CDATA[<pre><code>&lt;html&gt;&lt;body&gt;Hello, world!&lt;/body&gt;&lt;/html&gt;
</code></pre>
<p>YMMD! <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>
]]></description><link>https://www.c-plusplus.net/forum/post/2327939</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2327939</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Sun, 02 Jun 2013 08:13:36 GMT</pubDate></item><item><title><![CDATA[Reply to getline-Problem on Sun, 02 Jun 2013 20:33:24 GMT]]></title><description><![CDATA[<p>Seikuassi schrieb:</p>
<blockquote>
<p>Warum gibt der Compiler aber ein Fehler aus, wenn ich</p>
<pre><code>const int * x = 39;
cout &lt;&lt; x;
</code></pre>
<p>schreibe?</p>
</blockquote>
<p>Weil 39 ein Integer ist und kein Zeiger auf einen Integer.</p>
<p>Seikuassi schrieb:</p>
<blockquote>
<pre><code>const char * x =&quot;39&quot;;
cout &lt;&lt; x;
</code></pre>
<p>würde aber gehen. Warum ist das denn jetzt so?</p>
</blockquote>
<p>Das geht, weil &quot;39&quot; ein String-Literal ist. Und String-Literals sind const char-Arrays. Und Arrays können implizit zu einem Zeiger auf ihr erstes Element umgewandelt werden.</p>
<p>Ein char-Literal wäre '3', und <code>const char * x ='3';</code> geht genau so wenig wie <code>const int * x = 39;</code> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2328159</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2328159</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Sun, 02 Jun 2013 20:33:24 GMT</pubDate></item></channel></rss>