<?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[Shift Buffer]]></title><description><![CDATA[<p>Hallo, folgender buffer</p>
<pre><code>BYTE  abBuffer[150];
</code></pre>
<p>muss um einen bestimmten Wert nach links geshiftet werden. Habe es so probiert ..</p>
<pre><code>// shift abBuffer um len nach links
	for (i=0; i&lt;150-len; i++){
		buf[i]=buf[i+len];
		}
</code></pre>
<p>funktioniert aber nicht! Folgende Fehlermeldung wird ausgespuckt:</p>
<blockquote>
<p>error C2166: L-Wert gibt ein konstantes Objekt an</p>
</blockquote>
<p>Kann mir da jemand helfen?</p>
<p>Gruß<br />
daMike</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/146008/shift-buffer</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 06:58:30 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/146008.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 03 May 2006 11:36:21 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Shift Buffer on Wed, 03 May 2006 11:36:21 GMT]]></title><description><![CDATA[<p>Hallo, folgender buffer</p>
<pre><code>BYTE  abBuffer[150];
</code></pre>
<p>muss um einen bestimmten Wert nach links geshiftet werden. Habe es so probiert ..</p>
<pre><code>// shift abBuffer um len nach links
	for (i=0; i&lt;150-len; i++){
		buf[i]=buf[i+len];
		}
</code></pre>
<p>funktioniert aber nicht! Folgende Fehlermeldung wird ausgespuckt:</p>
<blockquote>
<p>error C2166: L-Wert gibt ein konstantes Objekt an</p>
</blockquote>
<p>Kann mir da jemand helfen?</p>
<p>Gruß<br />
daMike</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1050214</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1050214</guid><dc:creator><![CDATA[daMike]]></dc:creator><pubDate>Wed, 03 May 2006 11:36:21 GMT</pubDate></item><item><title><![CDATA[Reply to Shift Buffer on Wed, 03 May 2006 11:39:47 GMT]]></title><description><![CDATA[<p>wie sieht denn 'buf' aus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1050216</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1050216</guid><dc:creator><![CDATA[net 0]]></dc:creator><pubDate>Wed, 03 May 2006 11:39:47 GMT</pubDate></item><item><title><![CDATA[Reply to Shift Buffer on Wed, 03 May 2006 11:40:21 GMT]]></title><description><![CDATA[<p>Du definierst dein Array als &quot;abBuffer&quot; und dann rechnest du mit einer Variablen &quot;buf&quot; - wie werden die beiden einander zugeordnet? (und welchen Typ hat &quot;buf&quot;?)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1050217</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1050217</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 03 May 2006 11:40:21 GMT</pubDate></item><item><title><![CDATA[Reply to Shift Buffer on Wed, 03 May 2006 11:49:15 GMT]]></title><description><![CDATA[<p>sorry, abBuffer und buf sind identisch! Der Datentype ist BYTE!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1050230</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1050230</guid><dc:creator><![CDATA[daMike]]></dc:creator><pubDate>Wed, 03 May 2006 11:49:15 GMT</pubDate></item><item><title><![CDATA[Reply to Shift Buffer on Wed, 03 May 2006 11:53:11 GMT]]></title><description><![CDATA[<p>Was meinst du mit &quot;identisch&quot;? (ein bisschen mehr Code wäre hilfreich)</p>
<p>Und der Fehlercode lässt vermuten, daß buf ein &quot;const BYTE*&quot; oder &quot;const BYTE[]&quot; sein dürfte. Also solltest du mal ein minimales compilierbares Beispiel angeben, an dem sich der Fehler rekonstruieren lässt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1050232</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1050232</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 03 May 2006 11:53:11 GMT</pubDate></item><item><title><![CDATA[Reply to Shift Buffer on Wed, 03 May 2006 13:02:39 GMT]]></title><description><![CDATA[<p>sorry, aber der code ist ziemlich verstreut; BYTE müsste unsigned char const* sein; abBuffer wird im MAIN benützt und an ein Funktion übergeben, welche</p>
<pre><code>unsigned char const* buf
</code></pre>
<p>draus macht; anbei noch der Code von der Funktion:</p>
<pre><code>/*---------------------------------------------------------------------------------------*/
CString ShiftabBuffer (unsigned char const* buf, unsigned int len){

	//Variablen
	int i,k,j;
	CString RxD_Daten;
	CString IDbuf[10];

	RxD_Daten =  buf;

	// Verleichsheader
	IDbuf[0]=&quot;RD0&quot;;
	IDbuf[1]=&quot;VE0&quot;;
	IDbuf[2]=&quot;SS0&quot;;
	IDbuf[3]=&quot;SI0&quot;;
	IDbuf[4]=&quot;DP0&quot;;

	j = RxD_Daten.GetLength();

	// shift RxD_Daten um len nach links
	for (i=0; i&lt;j-len; i++){
		RxD_Daten = RxD_Daten.Right(j-len);
		}

	// suche nach weiterer Message
	k = 0;
	for (i=0; i&lt;5; i++){
		k = RxD_Daten.Find(IDbuf[i]);
		RxD_Daten = RxD_Daten.Right(150-len-k);
		}	
return RxD_Daten; 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1050286</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1050286</guid><dc:creator><![CDATA[daMike]]></dc:creator><pubDate>Wed, 03 May 2006 13:02:39 GMT</pubDate></item><item><title><![CDATA[Reply to Shift Buffer on Thu, 04 May 2006 06:36:42 GMT]]></title><description><![CDATA[<p>daMike schrieb:</p>
<blockquote>
<p>welche</p>
<pre><code>unsigned char const* buf
</code></pre>
<p>draus macht;</p>
</blockquote>
<p>Und da ist das const zu viel, wenn du den übergebenen Buffer ändern willst.</p>
<blockquote>
<pre><code>// shift RxD_Daten um len nach links
for (i=0; i&lt;j-len; i++){
	RxD_Daten = RxD_Daten.Right(j-len);
}
</code></pre>
</blockquote>
<p>An der Stelle reicht schon der einzelne Befehl &quot;RxD_Daten = RxD_Daten.Right(j-len);&quot; aus, um die ersten 'len' Zeichen des Strings abzuschneiden - wenn du das j-len mal machst, bleibt vermutlich nicht viel von deinem String übrig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1050638</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1050638</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 04 May 2006 06:36:42 GMT</pubDate></item></channel></rss>