<?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[buchstabe aus einem char* löschen]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein char-array, und möchte mit einer funktionen einen buchstabe herauslöschen...</p>
<p>doch wie??</p>
<pre><code class="language-cpp">void SerialString::Delete(int pos)
{
	   char* tempbefore = m_text;   //das funktioniert ja
	   char* tempafter = new char[pos];
	   int j=0;
	   for(int i=0;i&lt;StringLeng;i++)
		{
		*tempafter=*tempbefore;//alles probiert, mit [] usw....

		cout&lt;&lt;*tempbefore&lt;&lt;*tempafter&lt;&lt;endl; //hier zeigt er immer das richtige an		tempbefore++;
		tempafter++;
		}
	   cout&lt;&lt;&quot;Debugausgabe: &quot;&lt;&lt;*tempafter;  //hier kommt nur salat raus..., wie kopier ich denn chars verdammt? 

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/138664/buchstabe-aus-einem-char-löschen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 30 Aug 2026 05:09:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/138664.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 28 Feb 2006 11:30:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to buchstabe aus einem char* löschen on Tue, 28 Feb 2006 11:30:09 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich habe ein char-array, und möchte mit einer funktionen einen buchstabe herauslöschen...</p>
<p>doch wie??</p>
<pre><code class="language-cpp">void SerialString::Delete(int pos)
{
	   char* tempbefore = m_text;   //das funktioniert ja
	   char* tempafter = new char[pos];
	   int j=0;
	   for(int i=0;i&lt;StringLeng;i++)
		{
		*tempafter=*tempbefore;//alles probiert, mit [] usw....

		cout&lt;&lt;*tempbefore&lt;&lt;*tempafter&lt;&lt;endl; //hier zeigt er immer das richtige an		tempbefore++;
		tempafter++;
		}
	   cout&lt;&lt;&quot;Debugausgabe: &quot;&lt;&lt;*tempafter;  //hier kommt nur salat raus..., wie kopier ich denn chars verdammt? 

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1004935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1004935</guid><dc:creator><![CDATA[ich_raffs_net]]></dc:creator><pubDate>Tue, 28 Feb 2006 11:30:09 GMT</pubDate></item><item><title><![CDATA[Reply to buchstabe aus einem char* löschen on Tue, 28 Feb 2006 11:32:37 GMT]]></title><description><![CDATA[<p>Du musst einfach alle Buchstaben dahinter in einer Schleife eine Stelle weiter nach vorne kopieren.</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1004940</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1004940</guid><dc:creator><![CDATA[FireFlow]]></dc:creator><pubDate>Tue, 28 Feb 2006 11:32:37 GMT</pubDate></item><item><title><![CDATA[Reply to buchstabe aus einem char* löschen on Tue, 28 Feb 2006 11:36:01 GMT]]></title><description><![CDATA[<p>Erstmal solltest du dir mal die std::string ansehen, die ist wesentlich einfacher zu nutzen als blanke char-Pointer. Und zweitens werden char-Arrays mittels strcpy(), memcpy() oder memmove() verschoben (welches du nimmst, hängt von der Anwendung ab - in deinem Fall wäre memmove() wohl am sichersten:</p>
<pre><code class="language-cpp">void Delete(int pos)
{
  char* target=m_data+pos;
  int len=m_size-pos;
  memmove(target,target+1,len);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1004942</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1004942</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Tue, 28 Feb 2006 11:36:01 GMT</pubDate></item></channel></rss>