<?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[Wann &#x27;&#x27; und wann &amp;quot;&amp;quot;]]></title><description><![CDATA[<p>Hey,<br />
Ich frage mich wann man in C++ '' oder &quot;&quot; benutzt,<br />
also z.b funktionier<br />
#define char &quot;a&quot;<br />
#define char 'a' gleich<br />
oder cout &lt;&lt; &quot;a&quot;<br />
cout &lt;&lt; 'a'</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/297876/wann-und-wann-quot-quot</link><generator>RSS for Node</generator><lastBuildDate>Fri, 14 Aug 2026 06:39:41 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/297876.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 08 Jan 2012 21:29:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wann &#x27;&#x27; und wann &amp;quot;&amp;quot; on Sun, 08 Jan 2012 21:29:36 GMT]]></title><description><![CDATA[<p>Hey,<br />
Ich frage mich wann man in C++ '' oder &quot;&quot; benutzt,<br />
also z.b funktionier<br />
#define char &quot;a&quot;<br />
#define char 'a' gleich<br />
oder cout &lt;&lt; &quot;a&quot;<br />
cout &lt;&lt; 'a'</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2165571</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2165571</guid><dc:creator><![CDATA[Miriiam]]></dc:creator><pubDate>Sun, 08 Jan 2012 21:29:36 GMT</pubDate></item><item><title><![CDATA[Reply to Wann &#x27;&#x27; und wann &amp;quot;&amp;quot; on Sun, 08 Jan 2012 21:34:42 GMT]]></title><description><![CDATA[<p>Was in ' ' steht ist ein Zeichenliteral (Typ const char). Was in &quot; &quot; steht ist ein Zeichenkettenliteral (Typ const char[soviele zeichen wie es lang ist plus eines für die Nullterminierung]).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2165573</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2165573</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Sun, 08 Jan 2012 21:34:42 GMT</pubDate></item><item><title><![CDATA[Reply to Wann &#x27;&#x27; und wann &amp;quot;&amp;quot; on Sun, 08 Jan 2012 21:35:03 GMT]]></title><description><![CDATA[<p>&quot;&quot; sind sozusagen Strings und '' sind chars.<br />
Also z.B</p>
<pre><code class="language-cpp">std::string s = &quot;hallo&quot;; // ok
std::string s2 = 'hallo'; // nicht ok
char c = 'a'; // ok
char c2 = &quot;abcd&quot;; // nicht ok
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2165574</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2165574</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sun, 08 Jan 2012 21:35:03 GMT</pubDate></item><item><title><![CDATA[Reply to Wann &#x27;&#x27; und wann &amp;quot;&amp;quot; on Sun, 08 Jan 2012 21:35:48 GMT]]></title><description><![CDATA[<p>Danke <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/2165575</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2165575</guid><dc:creator><![CDATA[Miriiam]]></dc:creator><pubDate>Sun, 08 Jan 2012 21:35:48 GMT</pubDate></item><item><title><![CDATA[Reply to Wann &#x27;&#x27; und wann &amp;quot;&amp;quot; on Sun, 08 Jan 2012 22:42:17 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>Was in ' ' steht ist ein Zeichenliteral (Typ const char).</p>
</blockquote>
<p>Es gibt keine const PRvalues von skalaren Typen.</p>
<pre><code class="language-cpp">#include &lt;cassert&gt;
#include &lt;iostream&gt;
#include &lt;type_traits&gt;

template&lt;class T, class P&gt;
bool check_type(P&amp;&amp;) {
  return std::is_same&lt;
      T,
      typename std::remove_reference&lt;P&gt;::type
    &gt;::value;
}

int main() {
  assert(check_type&lt;const char[6]&gt;(&quot;Hallo&quot;));
  if (check_type&lt;const char&gt;('?')) {
    std::cout &lt;&lt; &quot;SeppJ hat recht.\n&quot;;
  } else {
    std::cout &lt;&lt; &quot;SeppJ hat unrecht.\n&quot;;
    assert(check_type&lt;char&gt;('?'));
  }
  assert(false &amp;&amp; &quot;assertions sind wirklich an&quot;);
}
</code></pre>
<p><a href="http://ideone.com/RmcSg" rel="nofollow">http://ideone.com/RmcSg</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2165596</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2165596</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Sun, 08 Jan 2012 22:42:17 GMT</pubDate></item><item><title><![CDATA[Reply to Wann &#x27;&#x27; und wann &amp;quot;&amp;quot; on Sun, 08 Jan 2012 23:02:54 GMT]]></title><description><![CDATA[<p>krümelkacker schrieb:</p>
<blockquote>
<p>SeppJ schrieb:</p>
<blockquote>
<p>Was in ' ' steht ist ein Zeichenliteral (Typ const char).</p>
</blockquote>
<p>Es gibt keine const PRvalues von skalaren Typen.</p>
<pre><code class="language-cpp">#include &lt;cassert&gt;
#include &lt;iostream&gt;
#include &lt;type_traits&gt;
 
template&lt;class T, class P&gt;
bool check_type(P&amp;&amp;) {
  return std::is_same&lt;
      T,
      typename std::remove_reference&lt;P&gt;::type
    &gt;::value;
}
 
int main() {
  assert(check_type&lt;const char[6]&gt;(&quot;Hallo&quot;));
  if (check_type&lt;const char&gt;('?')) {
    std::cout &lt;&lt; &quot;SeppJ hat recht.\n&quot;;
  } else {
    std::cout &lt;&lt; &quot;SeppJ hat unrecht.\n&quot;;
    assert(check_type&lt;char&gt;('?'));
  }
  assert(false &amp;&amp; &quot;assertions sind wirklich an&quot;);
}
</code></pre>
<p><a href="http://ideone.com/RmcSg" rel="nofollow">http://ideone.com/RmcSg</a></p>
</blockquote>
<p>Typen kannste Dir leichter anzeigen lassen. <a href="http://ideone.com/5AS7j" rel="nofollow">http://ideone.com/5AS7j</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2165601</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2165601</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sun, 08 Jan 2012 23:02:54 GMT</pubDate></item><item><title><![CDATA[Reply to Wann &#x27;&#x27; und wann &amp;quot;&amp;quot; on Sun, 08 Jan 2012 23:56:55 GMT]]></title><description><![CDATA[<p>...wobei es da jetzt noch unterschiede gibt. Mir war es wichtig, dass kein decay stattfindet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2165608</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2165608</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Sun, 08 Jan 2012 23:56:55 GMT</pubDate></item><item><title><![CDATA[Reply to Wann &#x27;&#x27; und wann &amp;quot;&amp;quot; on Mon, 09 Jan 2012 00:01:59 GMT]]></title><description><![CDATA[<p>krümelkacker schrieb:</p>
<blockquote>
<p>...wobei es da jetzt noch unterschiede gibt. Mir war es wichtig, dass kein decay stattfindet.</p>
</blockquote>
<p>Was ist ein decay?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2165610</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2165610</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Mon, 09 Jan 2012 00:01:59 GMT</pubDate></item><item><title><![CDATA[Reply to Wann &#x27;&#x27; und wann &amp;quot;&amp;quot; on Mon, 09 Jan 2012 00:08:20 GMT]]></title><description><![CDATA[<p>const char[6] ---[array-to-pointer-decay]--&gt; const char* PRvalue</p>
<p><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>
]]></description><link>https://www.c-plusplus.net/forum/post/2165611</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2165611</guid><dc:creator><![CDATA[krümelkacker]]></dc:creator><pubDate>Mon, 09 Jan 2012 00:08:20 GMT</pubDate></item></channel></rss>