<?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[String an Object übergeben !]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie kann ich in C++ an ein Object ein String als Variable übergeben.<br />
Also:</p>
<p>Object-&gt;Variable=20; und jetzt hab ich die Variable als CString vorliegen,</p>
<p>also:</p>
<p>CString test=&quot;Variable&quot;;<br />
Object-&gt;test=20; ??????</p>
<p>Wie lauten die Übergabeparameter in C++ ?</p>
<p>Danke</p>
<p>Gruß Euro.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/121870/string-an-object-übergeben</link><generator>RSS for Node</generator><lastBuildDate>Sat, 22 Aug 2026 21:52:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/121870.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 28 Sep 2005 08:52:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to String an Object übergeben ! on Wed, 28 Sep 2005 08:52:53 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>wie kann ich in C++ an ein Object ein String als Variable übergeben.<br />
Also:</p>
<p>Object-&gt;Variable=20; und jetzt hab ich die Variable als CString vorliegen,</p>
<p>also:</p>
<p>CString test=&quot;Variable&quot;;<br />
Object-&gt;test=20; ??????</p>
<p>Wie lauten die Übergabeparameter in C++ ?</p>
<p>Danke</p>
<p>Gruß Euro.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/881933</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/881933</guid><dc:creator><![CDATA[eurofreddy]]></dc:creator><pubDate>Wed, 28 Sep 2005 08:52:53 GMT</pubDate></item><item><title><![CDATA[Reply to String an Object übergeben ! on Wed, 28 Sep 2005 09:09:09 GMT]]></title><description><![CDATA[<p>Weiß nicht, ob dich verstanden habe. Du willst nen dynamischen Lookup von Membervariablen? C++ ist statisch.</p>
<p>Kannst aber ne Map verwenden:</p>
<pre><code class="language-cpp">sutrct DeinTollesObject {
   std::map&lt;std::string, int&gt; foo;
   ...
};

DeinTollesObject object;

object.foo[&quot;Variable&quot;] = 20;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/881948</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/881948</guid><dc:creator><![CDATA[Helium]]></dc:creator><pubDate>Wed, 28 Sep 2005 09:09:09 GMT</pubDate></item><item><title><![CDATA[Reply to String an Object übergeben ! on Wed, 28 Sep 2005 09:44:22 GMT]]></title><description><![CDATA[<p>Hallo danke für die Antwort,</p>
<p>ähm glaub des hilft mir nur bedingt.<br />
Die Sache sieht genauer so aus:</p>
<p>Es gibt eine Classe Image. In dieser Classe gibt es einen Struct Para, dieser hat als Variablen 3 double a,b,c.<br />
Dan hab ich mehrere Objecte:</p>
<p>Para test1;<br />
Para test2;</p>
<p>Nun hab ich ja Image-&gt;test1.a Image-&gt;test1.b usw.</p>
<p>Ich bekomme jetzt aus nem Textfile als CString wert=test1.a zurück.<br />
Nun will ich mit:</p>
<p>Image-&gt;wert=20; etwas in diese Variable schreiben. Der Kompiler mag aber:<br />
Image-&gt;wert nicht auch Image-&gt;&amp;wert mag er nicht.</p>
<p>Wie setzte ich so etwas um ?</p>
<p>Danke Gruß Euro.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/881972</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/881972</guid><dc:creator><![CDATA[eurofreddy]]></dc:creator><pubDate>Wed, 28 Sep 2005 09:44:22 GMT</pubDate></item><item><title><![CDATA[Reply to String an Object übergeben ! on Wed, 28 Sep 2005 09:56:38 GMT]]></title><description><![CDATA[<p>eurofreddy schrieb:</p>
<blockquote>
<p>Wie setzte ich so etwas um ?</p>
</blockquote>
<p>Das geht in C++ nicht direkt. Du kannst, wie Helium schon sagte, eine Map benutzen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/881981</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/881981</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Wed, 28 Sep 2005 09:56:38 GMT</pubDate></item><item><title><![CDATA[Reply to String an Object übergeben ! on Wed, 28 Sep 2005 10:28:34 GMT]]></title><description><![CDATA[<p>Ehm, du willst sowas:</p>
<pre><code class="language-cpp">class MyClass {
    public void ichWillEinenString(const CString &amp;str) {
      //...
   }
};
</code></pre>
<pre><code class="language-cpp">myobj.ichWillEinenString(string);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/881995</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/881995</guid><dc:creator><![CDATA[Artchi]]></dc:creator><pubDate>Wed, 28 Sep 2005 10:28:34 GMT</pubDate></item><item><title><![CDATA[Reply to String an Object übergeben ! on Wed, 28 Sep 2005 15:32:14 GMT]]></title><description><![CDATA[<p>So würd ich das auch machen, mit get- und set-Methoden und Para vieleicht als array von structs oder wegen der OOP als Klasse.</p>
<pre><code>getPara(int para_nr, char para_part){ 
    ...
  }

  setPara(int para_nr, char para_part, string neu){
    ...
  }
</code></pre>
<p>para_nr stellt die konkrette para struct dar und para_part das was du genau gaben willst</p>
]]></description><link>https://www.c-plusplus.net/forum/post/882279</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/882279</guid><dc:creator><![CDATA[imhotep]]></dc:creator><pubDate>Wed, 28 Sep 2005 15:32:14 GMT</pubDate></item></channel></rss>