<?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[init funktion verständnis problem]]></title><description><![CDATA[<p>Hallo ich habe ein Verständnis Problem und bräuchte einen Denkanstoss:</p>
<pre><code class="language-cpp">class XmlConfig {

public:

	XmlConfig();
	bool initialize(); 

private:

	TiXmlDocument doc;

};

bool XmlConfig::initialize()

	{
		doc(&quot;exmlfile&quot;);  // No match for call to (TiXmlDocument) (const char [9])

		if(!doc.LoadFile()){
			return false;}
		return true; 

}
</code></pre>
<p>Das object doc ist ein TinyXml Document:</p>
<p>tinyxml.h:</p>
<pre><code class="language-cpp">class TiXmlDocument : public TiXmlNode
{
public:
	/// Create an empty document, that has no name.
	TiXmlDocument();
	/// Create a document with a name. The name of the document is also the filename of the xml.
	TiXmlDocument( const char * documentName );

...

usw.
</code></pre>
<p>Ich würde das document gerne mit der init funktion 'initialisieren' um innerhalb meiner Klasse damit zu arbeiten.</p>
<p>Geht irgendwie net!?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/213154/init-funktion-verständnis-problem</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 13:19:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/213154.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 May 2008 19:05:16 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 19:05:16 GMT]]></title><description><![CDATA[<p>Hallo ich habe ein Verständnis Problem und bräuchte einen Denkanstoss:</p>
<pre><code class="language-cpp">class XmlConfig {

public:

	XmlConfig();
	bool initialize(); 

private:

	TiXmlDocument doc;

};

bool XmlConfig::initialize()

	{
		doc(&quot;exmlfile&quot;);  // No match for call to (TiXmlDocument) (const char [9])

		if(!doc.LoadFile()){
			return false;}
		return true; 

}
</code></pre>
<p>Das object doc ist ein TinyXml Document:</p>
<p>tinyxml.h:</p>
<pre><code class="language-cpp">class TiXmlDocument : public TiXmlNode
{
public:
	/// Create an empty document, that has no name.
	TiXmlDocument();
	/// Create a document with a name. The name of the document is also the filename of the xml.
	TiXmlDocument( const char * documentName );

...

usw.
</code></pre>
<p>Ich würde das document gerne mit der init funktion 'initialisieren' um innerhalb meiner Klasse damit zu arbeiten.</p>
<p>Geht irgendwie net!?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509105</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509105</guid><dc:creator><![CDATA[dirkstr]]></dc:creator><pubDate>Wed, 14 May 2008 19:05:16 GMT</pubDate></item><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 19:08:04 GMT]]></title><description><![CDATA[<p>Was geht nicht? Was gibts für einen Fehler?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509106</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509106</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Wed, 14 May 2008 19:08:04 GMT</pubDate></item><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 19:12:07 GMT]]></title><description><![CDATA[<p>der hier:</p>
<p>No match for call to (TiXmlDocument) (const char [9])</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509109</guid><dc:creator><![CDATA[dirkstr]]></dc:creator><pubDate>Wed, 14 May 2008 19:12:07 GMT</pubDate></item><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 19:14:34 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">doc = TiXmlDocument(&quot;exmlfile&quot;);
</code></pre>
<p>Tipp:<a href="https://www.google.de/search?&amp;q=c%2B%2B%20initialisierungsliste" rel="nofollow">Google: c++ initialisierungsliste</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509110</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509110</guid><dc:creator><![CDATA[WennDann]]></dc:creator><pubDate>Wed, 14 May 2008 19:14:34 GMT</pubDate></item><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 19:19:59 GMT]]></title><description><![CDATA[<p>hmm jetzt meckert :</p>
<p>multiple definition of `XmlConfig::initialize()'</p>
<p>wenn ich initialize() ohne angabe der Klasse einsetze kennt er doc wieder nicht mehr.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509114</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509114</guid><dc:creator><![CDATA[dirkstr]]></dc:creator><pubDate>Wed, 14 May 2008 19:19:59 GMT</pubDate></item><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 19:24:43 GMT]]></title><description><![CDATA[<p>hast du den #include wächter?</p>
<pre><code class="language-cpp">#ifndef xml_h_
#define xml_h_ xml_h_

// dein class

#endif
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1509119</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509119</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Wed, 14 May 2008 19:24:43 GMT</pubDate></item><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 19:28:30 GMT]]></title><description><![CDATA[<p>hmm ich habe die definition via header file weggelassen da es eine ziemlich kleine Klasse wird. Allerdings include ich in einem anderen file die XmlConfig.cpp. Wo muss ich den include wächter benutzen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509123</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509123</guid><dc:creator><![CDATA[dirkstr]]></dc:creator><pubDate>Wed, 14 May 2008 19:28:30 GMT</pubDate></item><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 19:41:42 GMT]]></title><description><![CDATA[<p>ich bin sicher das dies mein Problem ist nur ich habe keine Ahnung wie ich das in meinem Fall ( keine Header Datei ) umsetzen soll.</p>
<pre><code>#ifndef XMLCONFIG_cpp_
#define XMLCONFIG_cpp_ XMLCONFIG_cpp_ 

class class XmlConfig {

...
};

#endif
</code></pre>
<p>habe ich versucht, keine Änderung.</p>
<p>Muss ich mit einer header Datei arbeiten??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509129</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509129</guid><dc:creator><![CDATA[dirkstr]]></dc:creator><pubDate>Wed, 14 May 2008 19:41:42 GMT</pubDate></item><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 19:54:33 GMT]]></title><description><![CDATA[<p>Evtl. einen Tipp!?</p>
<p>Ich möchte die oben angegebene Klasse in einer anderen source benutzen.</p>
<p>Ich habe aber keine header datei erstellt, sondern die cpp datei included.</p>
<p>Das nimmt mir der linker über. Wo muss ich den include wächter installieren?</p>
<p>Oder gehts garnicht und ich muss einen header erstellen ??</p>
<p>HILFE</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509135</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509135</guid><dc:creator><![CDATA[dirkstr]]></dc:creator><pubDate>Wed, 14 May 2008 19:54:33 GMT</pubDate></item><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 19:58:44 GMT]]></title><description><![CDATA[<p>Wenn die Klasse sehr klein ist kann man sie auch ganz in den Header packen und da gehören auch die Include-Guards hin.<br />
cpp-Dateien inkludiert man nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509140</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509140</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Wed, 14 May 2008 19:58:44 GMT</pubDate></item><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 20:06:17 GMT]]></title><description><![CDATA[<p>Braunstein schrieb:</p>
<blockquote>
<p>Wenn die Klasse sehr klein ist kann man sie auch ganz in den Header packen und da gehören auch die Include-Guards hin.<br />
cpp-Dateien inkludiert man nicht.</p>
</blockquote>
<p>Danke!</p>
<p>Ich dachte auch daran aber da ich gehört habe das man in header files keine anderen header included sollte habe ich das nicht getan.</p>
<p>Die Syntax die sich aus dem headerfile ergibt habe ich jetzt so benutzt:<br />
#ifndef XMLCONFIG_h_<br />
#define XMLCONFIG_h_ XMLCONFIG_h_</p>
<p>Ist das korrekt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509146</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509146</guid><dc:creator><![CDATA[dirkstr]]></dc:creator><pubDate>Wed, 14 May 2008 20:06:17 GMT</pubDate></item><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 20:34:11 GMT]]></title><description><![CDATA[<p>dirkstr schrieb:</p>
<blockquote>
<p>Ich dachte auch daran aber da ich gehört habe das man in header files keine anderen header included sollte habe ich das nicht getan.</p>
</blockquote>
<p>Hast du auch Argumente gehört? Mir fällt nämlich keins ein.</p>
<p>dirkstr schrieb:</p>
<blockquote>
<p>Ist das korrekt?</p>
</blockquote>
<p>Wenn sich am Ende deines Headers noch ein <code>#endif</code> findet: ja.</p>
<p>cheers, Swordfish</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509176</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509176</guid><dc:creator><![CDATA[Swordfish]]></dc:creator><pubDate>Wed, 14 May 2008 20:34:11 GMT</pubDate></item><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 20:37:35 GMT]]></title><description><![CDATA[<p>Swordfish schrieb:</p>
<blockquote>
<p>dirkstr schrieb:</p>
<blockquote>
<p>Ich dachte auch daran aber da ich gehört habe das man in header files keine anderen header included sollte habe ich das nicht getan.</p>
</blockquote>
<p>Hast du auch Argumente gehört? Mir fällt nämlich keins ein.</p>
</blockquote>
<p>Ich nehme mal an, dass er wo gelesen hat, dass man, wenn man was includet das wenn möglich in der cpp macht. Aber gegen includen in Headern spricht eigentlich nix.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509181</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509181</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Wed, 14 May 2008 20:37:35 GMT</pubDate></item><item><title><![CDATA[Reply to init funktion verständnis problem on Wed, 14 May 2008 21:20:27 GMT]]></title><description><![CDATA[<p>Ich kenne auch die Regel: jedes Header-File sollte so beschaffen sein dass ein .c(pp) File mit folgendem Inhalt fehlerfrei compiliert:</p>
<pre><code class="language-cpp">#include &quot;header.hpp&quot;
</code></pre>
<p>Oder anders: jedes Header File sollte selbst als Source-File compilierbar sein.</p>
<p>Und das erfordert sehr oft sogar dass man andere Header-Files inkludiert, da man mit forward declarations einfach nicht immer auskommt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1509211</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1509211</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Wed, 14 May 2008 21:20:27 GMT</pubDate></item></channel></rss>