<?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[linksverschiebung]]></title><description><![CDATA[<p>hi<br />
ich wollte wissen, ob die linksverschiebung (&lt;&lt;) standartmäßig implementiert ist und wenn nicht wie ich sie implementieren könnte.<br />
frank.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/274322/linksverschiebung</link><generator>RSS for Node</generator><lastBuildDate>Thu, 27 Aug 2026 15:12:07 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/274322.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 23 Sep 2010 19:05:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to linksverschiebung on Thu, 23 Sep 2010 19:05:47 GMT]]></title><description><![CDATA[<p>hi<br />
ich wollte wissen, ob die linksverschiebung (&lt;&lt;) standartmäßig implementiert ist und wenn nicht wie ich sie implementieren könnte.<br />
frank.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956600</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956600</guid><dc:creator><![CDATA[frank1234]]></dc:creator><pubDate>Thu, 23 Sep 2010 19:05:47 GMT</pubDate></item><item><title><![CDATA[Reply to linksverschiebung on Thu, 23 Sep 2010 19:19:20 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /><br />
Ja, die gibt es standardmäßig.</p>
<p>Wobei ich mir nicht sicher bin, ob ich deine Frage verstanden habe. Denn du weißt ja offensichtlich schon, dass es sie gibt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956607</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956607</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 23 Sep 2010 19:19:20 GMT</pubDate></item><item><title><![CDATA[Reply to linksverschiebung on Thu, 23 Sep 2010 19:24:36 GMT]]></title><description><![CDATA[<p>was passiert dann, wenn auchnoch der shiftoperator (&lt;&lt;) implementiert ist?<br />
wie kann ich explizit angeben, dass ich eine linksverschiebung machen will?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956612</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956612</guid><dc:creator><![CDATA[frank1234]]></dc:creator><pubDate>Thu, 23 Sep 2010 19:24:36 GMT</pubDate></item><item><title><![CDATA[Reply to linksverschiebung on Thu, 23 Sep 2010 19:36:18 GMT]]></title><description><![CDATA[<p>Was ist denn eine Linksverschiebung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956619</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956619</guid><dc:creator><![CDATA[TyRoXx]]></dc:creator><pubDate>Thu, 23 Sep 2010 19:36:18 GMT</pubDate></item><item><title><![CDATA[Reply to linksverschiebung on Thu, 23 Sep 2010 19:41:23 GMT]]></title><description><![CDATA[<p>ich schiebe alle bits um eine stelle nach vorne;</p>
<p>aus 1 (0001) wird 2 (0010)<br />
aus 8 (1000) wird 0 (0000)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956620</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956620</guid><dc:creator><![CDATA[frank1234]]></dc:creator><pubDate>Thu, 23 Sep 2010 19:41:23 GMT</pubDate></item><item><title><![CDATA[Reply to linksverschiebung on Thu, 23 Sep 2010 19:52:06 GMT]]></title><description><![CDATA[<p>Das wird immer verwirrender. Was meinst du denn, was der Linksschiebeoperator &lt;&lt; macht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956624</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956624</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 23 Sep 2010 19:52:06 GMT</pubDate></item><item><title><![CDATA[Reply to linksverschiebung on Fri, 24 Sep 2010 09:12:10 GMT]]></title><description><![CDATA[<p>frank1234 schrieb:</p>
<blockquote>
<p>was passiert dann, wenn auchnoch der shiftoperator (&lt;&lt;) implementiert ist?<br />
wie kann ich explizit angeben, dass ich eine linksverschiebung machen will?</p>
</blockquote>
<p>Mein Wörterbuch sagt: <code>left shift</code> = <code>Linksverschiebung</code><br />
Womit verwechselst du <code>&lt;&lt;</code> gerade?</p>
<p>Möglicherweise ist hier der Operator für <code>ostream</code> gemeint. Für eigene Klassen kann man den left shift natürlich zusätzlich zum Ausgabeoperator definieren. Man muss dafür nur wissen, wie man Operatoren überlädt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956767</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956767</guid><dc:creator><![CDATA[TyRoXx]]></dc:creator><pubDate>Fri, 24 Sep 2010 09:12:10 GMT</pubDate></item><item><title><![CDATA[Reply to linksverschiebung on Fri, 24 Sep 2010 11:29:34 GMT]]></title><description><![CDATA[<blockquote>
<p>Möglicherweise ist hier der Operator für ostream gemeint.</p>
</blockquote>
<p>ja.<br />
im index meines buches steht halt einmal &lt;&lt;(Operator),womit die linksverschiebung gemeint ist und einmal &lt;&lt;(Shift-operator), womit der operator für streams gemeint ist.</p>
<p>ich habe eine klasse geschrieben und es gibt einen fehler, wenn ich versuche zu verschieben.</p>
<pre><code class="language-cpp">using namespace std;

class A{
    public:
    A();
    virtual ~A();
    string s;
};

A::A(){s=&quot;asdf&quot;;};
A::~A(){};

int main(){
    A a;
    a=a&lt;&lt;2;
    return 0;
}
</code></pre>
<p>der fehler:</p>
<pre><code>error: no match for 'operator&lt;&lt;' in 'a &lt;&lt; 2'|
</code></pre>
<p>wieso gibt es den fehler wenn die verschiebung standartmäßig implementiert ist?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956840</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956840</guid><dc:creator><![CDATA[frank1234]]></dc:creator><pubDate>Fri, 24 Sep 2010 11:29:34 GMT</pubDate></item><item><title><![CDATA[Reply to linksverschiebung on Fri, 24 Sep 2010 11:38:10 GMT]]></title><description><![CDATA[<p>Für eigene Klassen ist der Shift-Operator natürlich <em>nicht</em> standardmäßig impelementiert (wir dachten, du meinst die Builtin-Typen). Woher soll der Compiler auch wissen, was du mit <code>a &lt;&lt; 2</code> meinen könntest? Reine Bitverschiebung bei Klassenvariablen ist jedenfalls keine gute Idee.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956844</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956844</guid><dc:creator><![CDATA[ipsec]]></dc:creator><pubDate>Fri, 24 Sep 2010 11:38:10 GMT</pubDate></item><item><title><![CDATA[Reply to linksverschiebung on Fri, 24 Sep 2010 14:08:14 GMT]]></title><description><![CDATA[<p>ah ok.....<br />
gibt es einen weg wie ich eine byte oder bitrepräsentation der variable bekommen kann?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956929</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956929</guid><dc:creator><![CDATA[frank1234]]></dc:creator><pubDate>Fri, 24 Sep 2010 14:08:14 GMT</pubDate></item><item><title><![CDATA[Reply to linksverschiebung on Fri, 24 Sep 2010 14:10:54 GMT]]></title><description><![CDATA[<p>frank1234 schrieb:</p>
<blockquote>
<p>ah ok.....<br />
gibt es einen weg wie ich eine byte oder bitrepräsentation der variable bekommen kann?</p>
</blockquote>
<p>Klar gibt es die. Die Adresse der Variable bekommst du mit &amp;. Was du damit machen willst, habe ich aber keine Ahnung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1956933</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1956933</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 24 Sep 2010 14:10:54 GMT</pubDate></item><item><title><![CDATA[Reply to linksverschiebung on Sat, 25 Sep 2010 00:03:35 GMT]]></title><description><![CDATA[<p>frank1234 schrieb:</p>
<blockquote>
<p>ah ok.....<br />
gibt es einen weg wie ich eine byte oder bitrepräsentation der variable bekommen kann?</p>
</blockquote>
<p>Gibt es. Mich würde allerdings der Fall stark interessieren, wo du meinst, das zu brauchen.</p>
<p>Nehmen wir z.B. einen string. Die string-Klasse sieht sehr vereinfacht so aus:</p>
<pre><code class="language-cpp">class string
{
    char* data;
public:
    // viele tolle Funktionen
};
</code></pre>
<p>Sie verwaltet dabei selbsständig den <code>data</code> -Zeiger (fordert Speicher an, gibt ihn frei). Wenn jetzt ein shiften möglich wäre, würde der Zeiger plötzlich einen gänzlich anderen Wert haben und praktisch alle Methoden von string (inklusive Destruktor) lösen plötzlich eine Zugriffsverletzung aus.</p>
<p>Wozu brauchst du das also?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1957140</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1957140</guid><dc:creator><![CDATA[ipsec]]></dc:creator><pubDate>Sat, 25 Sep 2010 00:03:35 GMT</pubDate></item></channel></rss>