<?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[anfänger zeiger-frage]]></title><description><![CDATA[<p>hallo, zusammen!</p>
<p>ich hab mal ne frage. wieso geht das:</p>
<pre><code class="language-cpp">int x = 1;
  int *y = &amp;x;
  *y = 2;
  ShowMessage(IntToStr(x));
</code></pre>
<p>aber das nicht?:</p>
<pre><code class="language-cpp">int *pHeight = &amp;MainForm-&gt;Image-&gt;Height;
  int *pWidth  = &amp;MainForm-&gt;Image-&gt;Width;

  pHeight -= 50;
  pWidth  -= 50;
</code></pre>
<p>hab ich was übersehn?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/85543/anfänger-zeiger-frage</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 14:37:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/85543.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 09 Sep 2004 19:39:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to anfänger zeiger-frage on Thu, 09 Sep 2004 19:39:53 GMT]]></title><description><![CDATA[<p>hallo, zusammen!</p>
<p>ich hab mal ne frage. wieso geht das:</p>
<pre><code class="language-cpp">int x = 1;
  int *y = &amp;x;
  *y = 2;
  ShowMessage(IntToStr(x));
</code></pre>
<p>aber das nicht?:</p>
<pre><code class="language-cpp">int *pHeight = &amp;MainForm-&gt;Image-&gt;Height;
  int *pWidth  = &amp;MainForm-&gt;Image-&gt;Width;

  pHeight -= 50;
  pWidth  -= 50;
</code></pre>
<p>hab ich was übersehn?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/603657</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/603657</guid><dc:creator><![CDATA[Gast123]]></dc:creator><pubDate>Thu, 09 Sep 2004 19:39:53 GMT</pubDate></item><item><title><![CDATA[Reply to anfänger zeiger-frage on Thu, 09 Sep 2004 19:57:17 GMT]]></title><description><![CDATA[<p>Du musst derefenzieren damit das funktioniert:</p>
<pre><code class="language-cpp">*pHeight -= 50;
*pWidth  -= 50;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/603674</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/603674</guid><dc:creator><![CDATA[PuppetMaster2k]]></dc:creator><pubDate>Thu, 09 Sep 2004 19:57:17 GMT</pubDate></item><item><title><![CDATA[Reply to anfänger zeiger-frage on Thu, 09 Sep 2004 20:05:46 GMT]]></title><description><![CDATA[<p>ups, ja stimmt. aber soweit kam ich erst gar nicht. der meckert schon an der stelle:</p>
<pre><code class="language-cpp">int *pHeight = &amp;MainForm-&gt;Image-&gt;Height;
</code></pre>
<blockquote>
<p>[C++ Fehler] main.cpp(93): E2027 Eine Speicheradresse muß verwendet werden</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/603680</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/603680</guid><dc:creator><![CDATA[Gast123]]></dc:creator><pubDate>Thu, 09 Sep 2004 20:05:46 GMT</pubDate></item><item><title><![CDATA[Reply to anfänger zeiger-frage on Thu, 09 Sep 2004 20:08:03 GMT]]></title><description><![CDATA[<p>Gast123 schrieb:</p>
<blockquote>
<pre><code class="language-cpp">int *pHeight = &amp;MainForm-&gt;Image-&gt;Height;
  int *pWidth  = &amp;MainForm-&gt;Image-&gt;Width;
</code></pre>
</blockquote>
<p>Height und Width sind Eigenschaften (__property), hinter denen für Lese- und Schreibzugriff zwei unterschiedliche<br />
Methoden oder Variablen (im Normalfall dann nur ein Variable) liegen. Wenn Du hier versuchst, die Adresse einer<br />
Variablen zuzuweisen, kann das eigentlich nur schwerlich gut gehen.<br />
Wenn ich mal die BCB-Hilfe zu TImage zitieren darf:</p>
<p>BCB-Hilfe schrieb:</p>
<blockquote>
<pre><code class="language-cpp">__property int Height = {read=FHeight, write=SetHeight, nodefault};
__property int Width = {read=FWidth, write=SetWidth, nodefault};
</code></pre>
</blockquote>
<p>Gruß,</p>
<p>Alexander</p>
]]></description><link>https://www.c-plusplus.net/forum/post/603681</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/603681</guid><dc:creator><![CDATA[Alexander Kempf]]></dc:creator><pubDate>Thu, 09 Sep 2004 20:08:03 GMT</pubDate></item><item><title><![CDATA[Reply to anfänger zeiger-frage on Fri, 10 Sep 2004 06:04:10 GMT]]></title><description><![CDATA[<p>Na ja,</p>
<p>das lesen des Wertes funktioniert noch (ich denke mal weil direkt FHeight zurückgegeben wird):</p>
<pre><code class="language-cpp">x = &amp;(Form1-&gt;Image1-&gt;Height);
</code></pre>
<p>Allerdings kann über diese Variable keinen Wert zurückgeschrieben werden.</p>
<p>Aber sogar ich (dem hier schon 'Zeigergewurscht1el' vorgeworfen wurde), verwende für die Grunddatentypen nur in den allerseltesten Fällen Zeiger...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/603822</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/603822</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 10 Sep 2004 06:04:10 GMT</pubDate></item><item><title><![CDATA[Reply to anfänger zeiger-frage on Mon, 13 Sep 2004 08:14:43 GMT]]></title><description><![CDATA[<p>ganz zur not kannste ja immer noch folgendes machen</p>
<pre><code>int *x = new int;
*x = Form1-&gt;Image1-&gt;Height;

// hier musste dann natürlich nur selber die variable löschen
delete x;
x = NULL;
</code></pre>
<p>hoffe das hilft</p>
<p>Errraddicator</p>
]]></description><link>https://www.c-plusplus.net/forum/post/605718</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605718</guid><dc:creator><![CDATA[Errraddicator]]></dc:creator><pubDate>Mon, 13 Sep 2004 08:14:43 GMT</pubDate></item><item><title><![CDATA[Reply to anfänger zeiger-frage on Mon, 13 Sep 2004 08:42:51 GMT]]></title><description><![CDATA[<p>Hi!</p>
<blockquote>
<p>int *x = new int;<br />
*x = Form1-&gt;Image1-&gt;Height;</p>
<p>// hier musste dann natürlich nur selber die variable löschen<br />
delete x;<br />
x = NULL;</p>
</blockquote>
<p>hää?? Und was soll das bringen?<br />
kann ich ja gleich schreiben<br />
int x = Form1-&gt;Image1-&gt;Height;</p>
<p>...aber wenn du unbedingt Zeiger brauchst: Wie Joe schon geschrieben hat, mit Klammern funktionierts...</p>
<p>Robert</p>
]]></description><link>https://www.c-plusplus.net/forum/post/605740</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605740</guid><dc:creator><![CDATA[rowisoft]]></dc:creator><pubDate>Mon, 13 Sep 2004 08:42:51 GMT</pubDate></item></channel></rss>