<?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[Etwas an einen Char anhängen]]></title><description><![CDATA[<p>Hi ich hab mir nen Rechner bei meinem Vater zugelegt und will ihn von meiner Mutter aus Fernsteuern. Ich möchte ne Remotecmd auf dem Rechner auf machen. Um die Ausgabe der Konsole bei meinem Vater ohen Pipes abzufangen, benutze ich diesen Code:</p>
<pre><code class="language-cpp">char buf[30];
string sbuffer (&quot;&quot;); 

.....

while(kalle!=SOCKET_ERROR)
  {
    recv(connectedSocket,buf,30,0);
    strcat(buf,&quot; &gt; C:\\temp.txt&quot;);
    system(buf);
    ifstream in(&quot;C:\\temp.txt&quot;);
    for (int a; a != 1024; ++a)
    {
    const char ch (in.get());
    sbuffer.push_back (ch);
    } 
    kalle=send(connectedSocket,sbuffer.c_str (),sbuffer.length(),0);
    cout &lt;&lt; &quot;inhalt der temp:&quot; &lt;&lt; sbuffer &lt;&lt; endl;

  }
</code></pre>
<p>Aber er hängt &gt; C:\\temp.txt leider nicht richtig dran, das hat den Effekt das in der temp.txt nix steht.</p>
<p>Wie mach ichs richtig?</p>
<p>mfG AKiller</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/230002/etwas-an-einen-char-anhängen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 27 Sep 2026 14:44:15 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/230002.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 19 Dec 2008 08:55:45 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Etwas an einen Char anhängen on Fri, 19 Dec 2008 08:55:45 GMT]]></title><description><![CDATA[<p>Hi ich hab mir nen Rechner bei meinem Vater zugelegt und will ihn von meiner Mutter aus Fernsteuern. Ich möchte ne Remotecmd auf dem Rechner auf machen. Um die Ausgabe der Konsole bei meinem Vater ohen Pipes abzufangen, benutze ich diesen Code:</p>
<pre><code class="language-cpp">char buf[30];
string sbuffer (&quot;&quot;); 

.....

while(kalle!=SOCKET_ERROR)
  {
    recv(connectedSocket,buf,30,0);
    strcat(buf,&quot; &gt; C:\\temp.txt&quot;);
    system(buf);
    ifstream in(&quot;C:\\temp.txt&quot;);
    for (int a; a != 1024; ++a)
    {
    const char ch (in.get());
    sbuffer.push_back (ch);
    } 
    kalle=send(connectedSocket,sbuffer.c_str (),sbuffer.length(),0);
    cout &lt;&lt; &quot;inhalt der temp:&quot; &lt;&lt; sbuffer &lt;&lt; endl;

  }
</code></pre>
<p>Aber er hängt &gt; C:\\temp.txt leider nicht richtig dran, das hat den Effekt das in der temp.txt nix steht.</p>
<p>Wie mach ichs richtig?</p>
<p>mfG AKiller</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1632739</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1632739</guid><dc:creator><![CDATA[AKiller]]></dc:creator><pubDate>Fri, 19 Dec 2008 08:55:45 GMT</pubDate></item><item><title><![CDATA[Reply to Etwas an einen Char anhängen on Fri, 19 Dec 2008 10:37:22 GMT]]></title><description><![CDATA[<p>Was steht denn vor strcat in buf und was macht er dann daraus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1632776</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1632776</guid><dc:creator><![CDATA[_matze]]></dc:creator><pubDate>Fri, 19 Dec 2008 10:37:22 GMT</pubDate></item><item><title><![CDATA[Reply to Etwas an einen Char anhängen on Fri, 19 Dec 2008 11:16:34 GMT]]></title><description><![CDATA[<p>[quote=&quot;_matze&quot;]Was steht denn vor strcat in buf</p>
<p>Ich schätze, auf jeden Fall zu viel. Der recv liest ja bis zu 30 Bytes in einen 30 char großen Puffer. Da noch was anzuhängen, kann in die Hose gehen, wenn nicht sicher ist, daß rechtzeitig im Puffer ein '\0' vorkommt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1632791</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1632791</guid><dc:creator><![CDATA[Belli]]></dc:creator><pubDate>Fri, 19 Dec 2008 11:16:34 GMT</pubDate></item></channel></rss>