<?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[pointers - hacking]]></title><description><![CDATA[<p>Content:<br />
• Declare two integer variables a and b, and an integer pointer pint.<br />
• Initialize the variables with a = 5 and b = 10, and let the pointer initially pointing to the address of a. Print out the values and the addresses of the variables and the pointer on the console.<br />
• The address which the pointer pointed to can be transferred from a to b by simply adding or subtracting a number. Set this input number with the keyboard.<br />
• Then print out the values and the addresses of a, b and *pint on the console again.<br />
• If the address of *pint equals to the address of b. Enter a new value 15 now using the pointer. And print out the values and the addresses of a, b and the pointer again.</p>
<pre><code>#include &lt;iostream&gt;
using namespace std;

int main()
{
    int a = 5;
    int b = 10;
    int *pint= &amp;a;
    int n;

    cout&lt;&lt;&quot;a: &quot;&lt;&lt;a&lt;&lt;&quot;\t&amp;a: &quot;&lt;&lt;&amp;a&lt;&lt;endl;
    cout&lt;&lt;&quot;b: &quot;&lt;&lt;b&lt;&lt;&quot;\t&amp;b: &quot;&lt;&lt;&amp;b&lt;&lt;endl;
    cout&lt;&lt;&quot;*pint: &quot;&lt;&lt;*pint&lt;&lt;&quot;\tpint: &quot;&lt;&lt;&amp;*pint&lt;&lt;endl;
    cout&lt;&lt;&quot;Enter val for pointer manipulation: &quot;;
    cin&gt;&gt;n;
    *pint+=n;
    cout&lt;&lt;&quot;a: &quot;&lt;&lt;a&lt;&lt;&quot;\t&amp;a: &quot;&lt;&lt;&amp;a&lt;&lt;endl;
    cout&lt;&lt;&quot;b: &quot;&lt;&lt;b&lt;&lt;&quot;\t&amp;b: &quot;&lt;&lt;&amp;b&lt;&lt;endl;
    cout&lt;&lt;&quot;*pint: &quot;&lt;&lt;*pint&lt;&lt;&quot;\tpint: &quot;&lt;&lt;&amp;*pint&lt;&lt;endl;

    return 0;
}
</code></pre>
<p>Ich komme an der Stelle nicht mehr weiter, wo man den pointer manipuliert....ich hab jegliche varianten versucht, aber leider nicht zum erfolg <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="😕"
    /> <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="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/329692/pointers-hacking</link><generator>RSS for Node</generator><lastBuildDate>Wed, 11 Nov 2026 22:40:20 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/329692.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 03 Dec 2014 20:40:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to pointers - hacking on Wed, 03 Dec 2014 20:40:15 GMT]]></title><description><![CDATA[<p>Content:<br />
• Declare two integer variables a and b, and an integer pointer pint.<br />
• Initialize the variables with a = 5 and b = 10, and let the pointer initially pointing to the address of a. Print out the values and the addresses of the variables and the pointer on the console.<br />
• The address which the pointer pointed to can be transferred from a to b by simply adding or subtracting a number. Set this input number with the keyboard.<br />
• Then print out the values and the addresses of a, b and *pint on the console again.<br />
• If the address of *pint equals to the address of b. Enter a new value 15 now using the pointer. And print out the values and the addresses of a, b and the pointer again.</p>
<pre><code>#include &lt;iostream&gt;
using namespace std;

int main()
{
    int a = 5;
    int b = 10;
    int *pint= &amp;a;
    int n;

    cout&lt;&lt;&quot;a: &quot;&lt;&lt;a&lt;&lt;&quot;\t&amp;a: &quot;&lt;&lt;&amp;a&lt;&lt;endl;
    cout&lt;&lt;&quot;b: &quot;&lt;&lt;b&lt;&lt;&quot;\t&amp;b: &quot;&lt;&lt;&amp;b&lt;&lt;endl;
    cout&lt;&lt;&quot;*pint: &quot;&lt;&lt;*pint&lt;&lt;&quot;\tpint: &quot;&lt;&lt;&amp;*pint&lt;&lt;endl;
    cout&lt;&lt;&quot;Enter val for pointer manipulation: &quot;;
    cin&gt;&gt;n;
    *pint+=n;
    cout&lt;&lt;&quot;a: &quot;&lt;&lt;a&lt;&lt;&quot;\t&amp;a: &quot;&lt;&lt;&amp;a&lt;&lt;endl;
    cout&lt;&lt;&quot;b: &quot;&lt;&lt;b&lt;&lt;&quot;\t&amp;b: &quot;&lt;&lt;&amp;b&lt;&lt;endl;
    cout&lt;&lt;&quot;*pint: &quot;&lt;&lt;*pint&lt;&lt;&quot;\tpint: &quot;&lt;&lt;&amp;*pint&lt;&lt;endl;

    return 0;
}
</code></pre>
<p>Ich komme an der Stelle nicht mehr weiter, wo man den pointer manipuliert....ich hab jegliche varianten versucht, aber leider nicht zum erfolg <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="😕"
    /> <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="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431040</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431040</guid><dc:creator><![CDATA[ChillStudent]]></dc:creator><pubDate>Wed, 03 Dec 2014 20:40:15 GMT</pubDate></item><item><title><![CDATA[Reply to pointers - hacking on Wed, 03 Dec 2014 21:04:54 GMT]]></title><description><![CDATA[<p>Zeile 13: Du gibst nicht den Wert und die Adresse des Zeigers aus, sondern das, worauf der Zeiger zeigt und die Adresse dessen, worauf der Zeiger zeigt. Nicht im Sinne der Aufgabe.<br />
Zeile 16: Wieder manipulierst du nicht den Zeiger, sondern das, worauf er zeigt. Lass überall das Dereferenzieren sein! Es geht hier schließlich darum, den Zeiger selbst zu ändern.<br />
Zeile 19: Siehe Zeile 13.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431047</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431047</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Wed, 03 Dec 2014 21:04:54 GMT</pubDate></item><item><title><![CDATA[Reply to pointers - hacking on Wed, 03 Dec 2014 21:12:18 GMT]]></title><description><![CDATA[<p>da der pointer auf die adresse von a zeigen soll...soll doch die ausgabe identisch sein wie die von a und adresse von a?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431048</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431048</guid><dc:creator><![CDATA[ChillStudent]]></dc:creator><pubDate>Wed, 03 Dec 2014 21:12:18 GMT</pubDate></item><item><title><![CDATA[Reply to pointers - hacking on Wed, 03 Dec 2014 21:23:07 GMT]]></title><description><![CDATA[<p>ChillStudent schrieb:</p>
<blockquote>
<p>da der pointer auf die adresse von a zeigen soll...soll doch die ausgabe identisch sein wie die von a und adresse von a?</p>
</blockquote>
<p>Die Ausgabe ist identisch mit dem Wert und der Adresse von a. Aber es ist nicht der Wert und die Adresse des Pointers! Diese sind es schließlich, die du ausgeben wolltest. Der Pointer ist eine eigene Variable mit einem eigenen Wert und einer eigenen Adresse. Diese sollst du ausgeben und später manipulieren.</p>
<p>Aus deinem anderen Thread, falls du es nicht gesehen hast:<br />
<a href="https://www.youtube.com/watch?v=i49_SNt4yfk" rel="nofollow">https://www.youtube.com/watch?v=i49_SNt4yfk</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431054</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431054</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Wed, 03 Dec 2014 21:23:07 GMT</pubDate></item><item><title><![CDATA[Reply to pointers - hacking on Wed, 03 Dec 2014 21:33:11 GMT]]></title><description><![CDATA[<p>zu der Zeile 13</p>
<p>einfach *pint und pint ausgeben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431058</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431058</guid><dc:creator><![CDATA[ChillStudent]]></dc:creator><pubDate>Wed, 03 Dec 2014 21:33:11 GMT</pubDate></item><item><title><![CDATA[Reply to pointers - hacking on Wed, 03 Dec 2014 21:39:16 GMT]]></title><description><![CDATA[<p>ChillStudent schrieb:</p>
<blockquote>
<p>zu der Zeile 13</p>
<p>einfach *pint und pint ausgeben?</p>
</blockquote>
<p>Nein, immer noch nicht. Was bedeutet ein Sternchen bei Zeigern? Was bedeuten (allgemein) &amp;-Zeichen angewandt auf eine Variable? Was möchtest du hier erreichen?</p>
<p>Bitte nicht so lange alle Kombinationen von * und &amp; durchprobieren, bis du zufällig die Lösung triffst. Nachdenken!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431063</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431063</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Wed, 03 Dec 2014 21:39:16 GMT</pubDate></item><item><title><![CDATA[Reply to pointers - hacking on Wed, 03 Dec 2014 22:12:00 GMT]]></title><description><![CDATA[<p>ich komme leider nicht auf die lösung :S<br />
pointers liegt mir nicht so, obwohl es bestimmt ziemlich einfach ist...</p>
<pre><code>#include &lt;iostream&gt;
using namespace std;

int main()
{
    int a = 5;
    int b = 10;
    int *pint= &amp;a;
    int n;

    cout&lt;&lt;&quot;a: &quot;&lt;&lt;a&lt;&lt;&quot;\t&amp;a: &quot;&lt;&lt;&amp;a&lt;&lt;endl;
    cout&lt;&lt;&quot;b: &quot;&lt;&lt;b&lt;&lt;&quot;\t&amp;b: &quot;&lt;&lt;&amp;b&lt;&lt;endl;
    cout&lt;&lt;&quot;*pint: &quot;&lt;&lt;*pint&lt;&lt;&quot;\tpint: &quot;&lt;&lt;pint&lt;&lt;endl;
    cout&lt;&lt;&quot;Enter val for pointer manipulation: &quot;;
    cin&gt;&gt;n;
    pint = &amp;b;
    cout&lt;&lt;&quot;a: &quot;&lt;&lt;a&lt;&lt;&quot;\t&amp;a: &quot;&lt;&lt;&amp;a&lt;&lt;endl;
    cout&lt;&lt;&quot;b: &quot;&lt;&lt;b&lt;&lt;&quot;\t&amp;b: &quot;&lt;&lt;&amp;b&lt;&lt;endl;
    cout&lt;&lt;&quot;*pint: &quot;&lt;&lt;*pint&lt;&lt;&quot;\tpint: &quot;&lt;&lt;pint&lt;&lt;endl;

    return 0;
}
</code></pre>
<p>ich weiß leider echt nicht weiter....sterchenchen auf ein zeiger heißt, dass die variable eine adresse eines integer wertes aufnehmen kann?<br />
und &amp; heißt es greift auf die Adresse zu?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431068</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431068</guid><dc:creator><![CDATA[ChillStudent]]></dc:creator><pubDate>Wed, 03 Dec 2014 22:12:00 GMT</pubDate></item><item><title><![CDATA[Reply to pointers - hacking on Wed, 03 Dec 2014 22:41:35 GMT]]></title><description><![CDATA[<p>ChillStudent schrieb:</p>
<blockquote>
<p>ich weiß leider echt nicht weiter....sterchenchen auf ein zeiger heißt, dass die variable eine adresse eines integer wertes aufnehmen kann?<br />
und &amp; heißt es greift auf die Adresse zu?</p>
</blockquote>
<p>Völlig daneben. Vielleicht solltest du dir nochmal den Lehrstoff oder die gegebenen Links ansehen? Du scheinst das Grundprinzip überhaupt nicht verstanden zu haben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2431072</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431072</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Wed, 03 Dec 2014 22:41:35 GMT</pubDate></item><item><title><![CDATA[Reply to pointers - hacking on Wed, 03 Dec 2014 22:47:39 GMT]]></title><description><![CDATA[<p>ich würde mich ja gerne nochmal hinsetzen und alles durcharbeiten, aber muss die aufgabe gleich hochladen...<br />
trotzdem danke ich euch für eure mühe <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/2431073</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2431073</guid><dc:creator><![CDATA[ChillStudent]]></dc:creator><pubDate>Wed, 03 Dec 2014 22:47:39 GMT</pubDate></item></channel></rss>