<?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[Funktion für INI Eintrag erweitern...]]></title><description><![CDATA[<p>Ich möchte in einer INI Datei einen Key Inhalt erweitern:</p>
<pre><code>[test]
bla=haus
</code></pre>
<p>Hier soll bei <strong>bla</strong> hinter <strong>haus</strong> ein neuer string angehängt werden.<br />
Ich habe folgende Funktion erstellt:</p>
<pre><code class="language-cpp">void addValueINI(string section, string key, string value, string file)
{	
	char Buffer[500], BufferSize[500];
	GetPrivateProfileSection( section.c_str(), LPSTR(key.c_str()), 400, file.c_str());

	cout &lt;&lt; Buffer &lt;&lt; endl;

	string newValue = Buffer;
	newValue += value;

	WritePrivateProfileString(section.c_str(), key.c_str(), newValue.c_str(), file.c_str());	
}
</code></pre>
<p>Wenn ich dann die Funktion aufrufe bekomme ich lauter Sonderzeichen vom Buffer.<br />
Was meint ihr dazu?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/168340/funktion-für-ini-eintrag-erweitern</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Jul 2026 14:10:48 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/168340.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 20 Dec 2006 21:59:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Funktion für INI Eintrag erweitern... on Wed, 20 Dec 2006 21:59:55 GMT]]></title><description><![CDATA[<p>Ich möchte in einer INI Datei einen Key Inhalt erweitern:</p>
<pre><code>[test]
bla=haus
</code></pre>
<p>Hier soll bei <strong>bla</strong> hinter <strong>haus</strong> ein neuer string angehängt werden.<br />
Ich habe folgende Funktion erstellt:</p>
<pre><code class="language-cpp">void addValueINI(string section, string key, string value, string file)
{	
	char Buffer[500], BufferSize[500];
	GetPrivateProfileSection( section.c_str(), LPSTR(key.c_str()), 400, file.c_str());

	cout &lt;&lt; Buffer &lt;&lt; endl;

	string newValue = Buffer;
	newValue += value;

	WritePrivateProfileString(section.c_str(), key.c_str(), newValue.c_str(), file.c_str());	
}
</code></pre>
<p>Wenn ich dann die Funktion aufrufe bekomme ich lauter Sonderzeichen vom Buffer.<br />
Was meint ihr dazu?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1195758</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1195758</guid><dc:creator><![CDATA[kernel64]]></dc:creator><pubDate>Wed, 20 Dec 2006 21:59:55 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion für INI Eintrag erweitern... on Wed, 20 Dec 2006 22:02:53 GMT]]></title><description><![CDATA[<p>ROFL <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> ... const-cast <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/26a0.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--warning"
      title=":warning:"
      alt="⚠"
    /> ...</p>
<p>Du kannst nicht einfach den Return-Wert der Methode c_str() in char* casten!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1195763</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1195763</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Wed, 20 Dec 2006 22:02:53 GMT</pubDate></item><item><title><![CDATA[Reply to Funktion für INI Eintrag erweitern... on Thu, 21 Dec 2006 06:20:11 GMT]]></title><description><![CDATA[<p>Was sollte denn in Buffer drinstehen?! Du befüllst es doch nirgends...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1195807</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1195807</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Thu, 21 Dec 2006 06:20:11 GMT</pubDate></item></channel></rss>