<?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[objekte übergeben]]></title><description><![CDATA[<p>huhu,</p>
<p>kann man objecte an eine funktion übergeben?</p>
<p>ich hab mir in der main ein objekt erstellt<br />
und will dieses object aber auch in einer funktion benutzen,<br />
irgendwie bekomme ich das nicht hin, wenn ich das objekt<br />
global erstelle gehts, klar.</p>
<p>kleines beispiel</p>
<pre><code class="language-cpp">main()
{
   obj meinobj;
   getinfos();
}

getinfos()
{
   int a;
   for(a=0;a&lt;4;a++)
   cout&lt;&lt;meinobj.meineMethode(&amp;a);
}
</code></pre>
<p>sowas in der art will ich machen, geht sowas überhaup?<br />
wenn ja wie?</p>
<p>vielen dank schon mal im voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/155221/objekte-übergeben</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 05:28:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/155221.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 03 Aug 2006 17:59:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to objekte übergeben on Thu, 03 Aug 2006 17:59:37 GMT]]></title><description><![CDATA[<p>huhu,</p>
<p>kann man objecte an eine funktion übergeben?</p>
<p>ich hab mir in der main ein objekt erstellt<br />
und will dieses object aber auch in einer funktion benutzen,<br />
irgendwie bekomme ich das nicht hin, wenn ich das objekt<br />
global erstelle gehts, klar.</p>
<p>kleines beispiel</p>
<pre><code class="language-cpp">main()
{
   obj meinobj;
   getinfos();
}

getinfos()
{
   int a;
   for(a=0;a&lt;4;a++)
   cout&lt;&lt;meinobj.meineMethode(&amp;a);
}
</code></pre>
<p>sowas in der art will ich machen, geht sowas überhaup?<br />
wenn ja wie?</p>
<p>vielen dank schon mal im voraus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1110124</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1110124</guid><dc:creator><![CDATA[adonis]]></dc:creator><pubDate>Thu, 03 Aug 2006 17:59:37 GMT</pubDate></item><item><title><![CDATA[Reply to objekte übergeben on Thu, 03 Aug 2006 18:06:19 GMT]]></title><description><![CDATA[<p>Hallo</p>
<pre><code class="language-cpp">int main()
{
   obj meinobj;
   getinfos(meinobj);
}

void getinfos(const obj &amp;curobj)
{
   for(int a=0;a&lt;4;a++)
   cout&lt;&lt;curobj.meineMethode(&amp;a);
}
</code></pre>
<p>da könnte natürlich getinfos aber auch gleich eine Methode von obj sein.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1110129</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1110129</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Thu, 03 Aug 2006 18:06:19 GMT</pubDate></item><item><title><![CDATA[Reply to objekte übergeben on Thu, 03 Aug 2006 18:09:14 GMT]]></title><description><![CDATA[<p>alles kein problem<br />
du musst das objekt als normalen parameter einer funktion betrachten</p>
<pre><code>#include &quot;A.h&quot;
#include &lt;string&gt;
#include &lt;iostream&gt;

using namespace std;

void muh (A ob);

int main (){

	A ob;

	muh(ob);

	cin.ignore();
	return 0;
	}

void muh (A ob){

	string s = &quot;hallo&quot;;
	ob.ausgabe(s);

	}
</code></pre>
<p>und die klasse</p>
<pre><code>#pragma once
#include &lt;iostream&gt; 
#include &lt;string&gt;

class A
	{
	public:

		A(void)
			{
			}

		~A(void)
			{
			}

		public: 

void ausgabe(std::string str) 
   { 
   std:: cout &lt;&lt; str; 
   }
	};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1110131</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1110131</guid><dc:creator><![CDATA[golden_jubilee]]></dc:creator><pubDate>Thu, 03 Aug 2006 18:09:14 GMT</pubDate></item><item><title><![CDATA[Reply to objekte übergeben on Thu, 03 Aug 2006 18:09:19 GMT]]></title><description><![CDATA[<p>Adonis und du traust es dich im Java vs C++ Thread die Klappe auf zu machen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1110132</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1110132</guid><dc:creator><![CDATA[Lolz]]></dc:creator><pubDate>Thu, 03 Aug 2006 18:09:19 GMT</pubDate></item><item><title><![CDATA[Reply to objekte übergeben on Thu, 03 Aug 2006 18:59:56 GMT]]></title><description><![CDATA[<p>als unregistrierter rein und sowas schreiben...</p>
<p>weiss auch nicht was das damit zu tun hat.<br />
vielleicht solltest mal richtig lesen und nicht nur jedes 5te<br />
wort und dir den rest zusammen reimen.</p>
<p>grob hab ich gesagt das mich diese intolleranz<br />
und subjektivität nervt, die mir extrem halt in dem bereich<br />
auffiell, was natürlich nicht heisst das sie nur dort vorkommmt.</p>
<p>und glaub das ich mir auch als nicht programmiergenie eine<br />
eigene meinung leisten darf.</p>
<p>und danke für die hilfe, vieles wird wieder klarer:)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1110155</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1110155</guid><dc:creator><![CDATA[adonis]]></dc:creator><pubDate>Thu, 03 Aug 2006 18:59:56 GMT</pubDate></item></channel></rss>