<?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[Wahrscheinlich nur gerade einfach zu blöde dazu :-(]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe einmal ein Main.cpp und einmal eine ein Headder<br />
nun möchte ich aus der Main folgendes aus machen.</p>
<ol>
<li>ein Objekt entsprechend dem Headder erzeugen / anlegen</li>
<li>mithilfe des angelegten Objektes eine Funktion aufrufen...</li>
</ol>
<p>Dürfte eigentlich ja nich so das Problem sein, hätte man mal mehr CPP anstelle von JAVA programmiert.</p>
<p>Kann mit bitte jemand unter die Arme greifen ???</p>
<pre><code>#include&lt;iostream&gt;

using namespace std;

class Campingplatzsystem;

int main(int nn, char *par[]){

	Campingplatzsystem *a1;

	a1-&gt;hallo_world();

	int a;
	cin &gt;&gt; a;
}
</code></pre>
<p>Headder</p>
<pre><code>#ifndef CAMPINGPLATZSYSTEM_H
#define CAMPINGPLATZSYSTEM_H

#include&lt;iostream&gt;
using namespace std;

class StellplatzListe;
class ReservierungsListe;
class CheckinListe;
class BenutzerListe;

class Gesamtpreis;
class Checkin;
class Reservierung;

class Stellplatz;
class Benutzer;

class Campingplatzsystem  {
private:

/**
 * @clientCardinality 1
 * @supplierCardinality 1
 * @label enthält
 * @directed true
*/
Gesamtpreis* lnkGesamtpreis1;
/**
 * @supplierCardinality 1
 * @clientCardinality 1
 * @label besitzt
 * @directed true
*/
BenutzerListe* lnkBenutzerListe1;
/**
 * @clientCardinality 1
 * @supplierCardinality 1
 * @label besitzt
 * @directed true
*/
CheckinListe* lnkCheckinListe1;
/**
 * @supplierCardinality 1
 * @clientCardinality 1
 * @label besitzt
 * @directed true
*/
ReservierungsListe* lnkReservierungsListe1;
/**
 * @clientCardinality 1
 * @supplierCardinality 1
 * @label besitzt
 * @directed true
*/
StellplatzListe* lnkStellplatzListe1;

int a;

public:
Campingplatzsystem();
void hallo_world();

};

#endif

Campingplatzsystem::Campingplatzsystem(){
	a = 99;
}

void Campingplatzsystem::hallo_world(){
	cout &lt;&lt; &quot;HELLO WORLD&quot; &lt;&lt; endl;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/170119/wahrscheinlich-nur-gerade-einfach-zu-blöde-dazu</link><generator>RSS for Node</generator><lastBuildDate>Thu, 17 Sep 2026 00:05:24 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/170119.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Jan 2007 22:49:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wahrscheinlich nur gerade einfach zu blöde dazu :-( on Thu, 11 Jan 2007 22:49:49 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Ich habe einmal ein Main.cpp und einmal eine ein Headder<br />
nun möchte ich aus der Main folgendes aus machen.</p>
<ol>
<li>ein Objekt entsprechend dem Headder erzeugen / anlegen</li>
<li>mithilfe des angelegten Objektes eine Funktion aufrufen...</li>
</ol>
<p>Dürfte eigentlich ja nich so das Problem sein, hätte man mal mehr CPP anstelle von JAVA programmiert.</p>
<p>Kann mit bitte jemand unter die Arme greifen ???</p>
<pre><code>#include&lt;iostream&gt;

using namespace std;

class Campingplatzsystem;

int main(int nn, char *par[]){

	Campingplatzsystem *a1;

	a1-&gt;hallo_world();

	int a;
	cin &gt;&gt; a;
}
</code></pre>
<p>Headder</p>
<pre><code>#ifndef CAMPINGPLATZSYSTEM_H
#define CAMPINGPLATZSYSTEM_H

#include&lt;iostream&gt;
using namespace std;

class StellplatzListe;
class ReservierungsListe;
class CheckinListe;
class BenutzerListe;

class Gesamtpreis;
class Checkin;
class Reservierung;

class Stellplatz;
class Benutzer;

class Campingplatzsystem  {
private:

/**
 * @clientCardinality 1
 * @supplierCardinality 1
 * @label enthält
 * @directed true
*/
Gesamtpreis* lnkGesamtpreis1;
/**
 * @supplierCardinality 1
 * @clientCardinality 1
 * @label besitzt
 * @directed true
*/
BenutzerListe* lnkBenutzerListe1;
/**
 * @clientCardinality 1
 * @supplierCardinality 1
 * @label besitzt
 * @directed true
*/
CheckinListe* lnkCheckinListe1;
/**
 * @supplierCardinality 1
 * @clientCardinality 1
 * @label besitzt
 * @directed true
*/
ReservierungsListe* lnkReservierungsListe1;
/**
 * @clientCardinality 1
 * @supplierCardinality 1
 * @label besitzt
 * @directed true
*/
StellplatzListe* lnkStellplatzListe1;

int a;

public:
Campingplatzsystem();
void hallo_world();

};

#endif

Campingplatzsystem::Campingplatzsystem(){
	a = 99;
}

void Campingplatzsystem::hallo_world(){
	cout &lt;&lt; &quot;HELLO WORLD&quot; &lt;&lt; endl;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1208352</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1208352</guid><dc:creator><![CDATA[Erick_77]]></dc:creator><pubDate>Thu, 11 Jan 2007 22:49:49 GMT</pubDate></item><item><title><![CDATA[Reply to Wahrscheinlich nur gerade einfach zu blöde dazu :-( on Thu, 11 Jan 2007 22:51:41 GMT]]></title><description><![CDATA[<p>bekomme immer folgenden Fehler:</p>
<p>1&gt;Kompilieren...<br />
1&gt;Main.cpp<br />
1&gt;.\Main.cpp(12) : error C2027: Verwendung des undefinierten Typs &quot;Campingplatzsystem&quot;<br />
1&gt; .\Main.cpp(5): Siehe Deklaration von 'Campingplatzsystem'<br />
1&gt;.\Main.cpp(12) : error C2227: Links von &quot;-&gt;hallo_world&quot; muss sich ein Zeiger auf Klassen-/Struktur-/Union-/generischen Typ befinden.<br />
1&gt;Das Buildprotokoll wurde unter &quot;file://e:\Eigene Dateien\Visual Studio 2005\Projects\Hausarbeit\Hausarbeit\Debug\BuildLog.htm&quot; gespeichert.<br />
1&gt;Hausarbeit - 2 Fehler, 0 Warnung(en)<br />
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1208356</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1208356</guid><dc:creator><![CDATA[Erick_77]]></dc:creator><pubDate>Thu, 11 Jan 2007 22:51:41 GMT</pubDate></item><item><title><![CDATA[Reply to Wahrscheinlich nur gerade einfach zu blöde dazu :-( on Thu, 11 Jan 2007 23:14:09 GMT]]></title><description><![CDATA[<p>.. im main.cpp das #include &quot;Campingplatzsystem.h&quot; vergessen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1208360</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1208360</guid><dc:creator><![CDATA[Werner Salomon]]></dc:creator><pubDate>Thu, 11 Jan 2007 23:14:09 GMT</pubDate></item><item><title><![CDATA[Reply to Wahrscheinlich nur gerade einfach zu blöde dazu :-( on Thu, 11 Jan 2007 23:22:34 GMT]]></title><description><![CDATA[<p>Nee darauf war/bin ich auch schon gekommen dann gibt es diese Fehlermeldung</p>
<p>Noch jemand ne Idee?</p>
<p>1&gt;Main.cpp<br />
1&gt;.\Main.cpp(6) : fatal error C1083: Datei (Include) kann nicht geöffnet werden: &quot;Campingplatzsystem.h&quot;: No such file or directory<br />
1&gt;Das Buildprotokoll wurde unter &quot;file://e:\Eigene Dateien\Visual Studio 2005\Projects\Hausarbeit\Hausarbeit\Debug\BuildLog.htm&quot; gespeichert.<br />
1&gt;Hausarbeit - 1 Fehler, 0 Warnung(en)<br />
========== Erstellen: 0 erfolgreich, Fehler bei 1, 0 aktuell, 0 übersprungen ==========</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1208366</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1208366</guid><dc:creator><![CDATA[Erick_77]]></dc:creator><pubDate>Thu, 11 Jan 2007 23:22:34 GMT</pubDate></item><item><title><![CDATA[Reply to Wahrscheinlich nur gerade einfach zu blöde dazu :-( on Thu, 11 Jan 2007 23:38:07 GMT]]></title><description><![CDATA[<p>Thread bitte löschen !!!<br />
Der Fehler Lag daran, das Visual die vorhandenen Dateien nicht ins richtige verZeichniss geschoben hat <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":-("
      alt="😞"
    /></p>
<p>that's live</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1208371</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1208371</guid><dc:creator><![CDATA[Erick_77]]></dc:creator><pubDate>Thu, 11 Jan 2007 23:38:07 GMT</pubDate></item><item><title><![CDATA[Reply to Wahrscheinlich nur gerade einfach zu blöde dazu :-( on Fri, 12 Jan 2007 07:21:47 GMT]]></title><description><![CDATA[<p>Erick_77 schrieb:</p>
<blockquote>
<pre><code>Campingplatzsystem *a1;

	a1-&gt;hallo_world();
</code></pre>
</blockquote>
<p>Das solltest du besser nicht machen - selbst wenn der Code so durch den Compiler geht, bekommst du spätestens bei der Ausführung Probleme, weil du kein Objekt angelegt hast (der Zeiger al zeigt ins Nirvana und du versuchst anschließend, fremde Speicherbereiche als Campingplatz zu deuten - im besten Fall beschwert sich dein Rechner mit einer Access Violation darüber, im schlimmsten Fall kommt nur Müll heraus).</p>
<p>Besser sieht es so aus:</p>
<pre><code class="language-cpp">Campingplatzsystem *al = new Campingplatzsystem;//Anlegen eines Objekts
al-&gt;hallo_world();
...
delete al;//Speicher freigeben

//oder

Campingplatzsystem al;
al.hallo_world();
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1208428</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1208428</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 12 Jan 2007 07:21:47 GMT</pubDate></item><item><title><![CDATA[Reply to Wahrscheinlich nur gerade einfach zu blöde dazu :-( on Fri, 12 Jan 2007 12:11:54 GMT]]></title><description><![CDATA[<p>Besten Dank</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1208651</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1208651</guid><dc:creator><![CDATA[Erick_77]]></dc:creator><pubDate>Fri, 12 Jan 2007 12:11:54 GMT</pubDate></item></channel></rss>