<?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[system() + string möglich ?]]></title><description><![CDATA[<p>Hallo,</p>
<pre><code class="language-cpp">void exestart(string exestart)
{

string localsystem = &quot;\&quot;start &quot;exestart\&quot;&quot;;
system(exestart);

}
</code></pre>
<pre><code class="language-cpp">exestart(firefox.exe);
</code></pre>
<p>ich möchte &quot;start firefox.exe&quot; beliebig durch einen anderen string ersetzen.</p>
<p>ist das möglich?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/292389/system-string-möglich</link><generator>RSS for Node</generator><lastBuildDate>Mon, 17 Aug 2026 01:09:27 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/292389.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 Sep 2011 17:35:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 17:37:48 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<pre><code class="language-cpp">void exestart(string exestart)
{

string localsystem = &quot;\&quot;start &quot;exestart\&quot;&quot;;
system(exestart);

}
</code></pre>
<pre><code class="language-cpp">exestart(firefox.exe);
</code></pre>
<p>ich möchte &quot;start firefox.exe&quot; beliebig durch einen anderen string ersetzen.</p>
<p>ist das möglich?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2116852</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2116852</guid><dc:creator><![CDATA[kantaki]]></dc:creator><pubDate>Thu, 08 Sep 2011 17:37:48 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 17:44:42 GMT]]></title><description><![CDATA[<p>Ja.</p>
<p><a href="http://www.cplusplus.com/reference/string/operator+/" rel="nofollow">http://www.cplusplus.com/reference/string/operator+/</a><br />
<a href="http://www.cplusplus.com/reference/string/string/c_str/" rel="nofollow">http://www.cplusplus.com/reference/string/string/c_str/</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2116861</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2116861</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 08 Sep 2011 17:44:42 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 17:45:17 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">system(mystr.c_str());
</code></pre>
<p>Aber lass system() bleiben, dafür gibts i.d.R. bessere Mittel.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2116863</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2116863</guid><dc:creator><![CDATA[314159265358979]]></dc:creator><pubDate>Thu, 08 Sep 2011 17:45:17 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 17:50:48 GMT]]></title><description><![CDATA[<p>okay super funktioniert <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title="=)"
      alt="🙂"
    /></p>
<p>aber warum muss ich einen cstring in system einfügen? wieso geht es nicht mit einem normalen string ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2116869</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2116869</guid><dc:creator><![CDATA[kantaki]]></dc:creator><pubDate>Thu, 08 Sep 2011 17:50:48 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 17:51:28 GMT]]></title><description><![CDATA[<p>Weil system eine C-Funktion ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2116871</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2116871</guid><dc:creator><![CDATA[314159265358979]]></dc:creator><pubDate>Thu, 08 Sep 2011 17:51:28 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 17:52:53 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/25315">@kantaki</a>,<br />
<a href="http://www.c-plusplus.net/forum/39453" rel="nofollow">http://www.c-plusplus.net/forum/39453</a></p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2116872</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2116872</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Thu, 08 Sep 2011 17:52:53 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 17:53:13 GMT]]></title><description><![CDATA[<p>du meintest ich sollte system lieber lassen.</p>
<p>wenn ich eine batch datei aufrufen will, habe ich da bessere alternativen als system() ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2116873</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2116873</guid><dc:creator><![CDATA[kantaki]]></dc:creator><pubDate>Thu, 08 Sep 2011 17:53:13 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 17:57:36 GMT]]></title><description><![CDATA[<p>kantaki schrieb:</p>
<blockquote>
<p>wenn ich eine batch datei aufrufen will, habe ich da bessere alternativen als system() ?</p>
</blockquote>
<p>Ja, verwende Plattform spezifischen Code. Für welches OS entwickelst du denn?</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2116877</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2116877</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Thu, 08 Sep 2011 17:57:36 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 18:00:41 GMT]]></title><description><![CDATA[<p>ich selber nutze windows 7 aber ich möchte eigentlich das es auch auf xp vista funktioniert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2116880</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2116880</guid><dc:creator><![CDATA[kantaki]]></dc:creator><pubDate>Thu, 08 Sep 2011 18:00:41 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 18:05:13 GMT]]></title><description><![CDATA[<p>kantaki schrieb:</p>
<blockquote>
<p>ich selber nutze windows 7 aber ich möchte eigentlich das is auch auf xp vista funktioniert.</p>
</blockquote>
<p>Das ist eigentlich kein Problem, solange es nicht noch Mac und Linux sein soll <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
In der <a href="http://www.c-plusplus.net/forum/f4" rel="nofollow">WinAPI Abteilung</a> kann man dir da besser helfen, aber grundsätzlich solltest du mit<a href="http://msdn.microsoft.com/en-us/library/bb762153.aspx" rel="nofollow"> <code>ShellExecute</code> </a>oder<a href="http://msdn.microsoft.com/en-us/library/ms682425.aspx" rel="nofollow"> <code>CreateProcess</code> </a>bedient sein.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2116885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2116885</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Thu, 08 Sep 2011 18:05:13 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 20:50:50 GMT]]></title><description><![CDATA[<p>okay leute eine frage hab ich noch. ich schwöre das ist die letzte für heute ^^</p>
<pre><code class="language-cpp">#include&lt;fstream&gt;
#include&lt;iostream&gt;
#include&lt;cstdlib&gt;
#include&lt;fstream&gt;
#include&lt;string&gt;
#include&lt;cstring&gt;
#include&lt;vector&gt;
using namespace std;
void multistarter( string exename, string site )
{
    char * cstr;
    string localsystem = &quot;\&quot;start &quot; + exename+&quot; &quot;+ site &quot;\&quot;&quot; ;
    cstr = new char [localsystem.size()+1];
    strcpy (cstr, localsystem.c_str());
    system(cstr);
    delete[] cstr;

}

int main()
{

    ifstream source;
    vector&lt;string&gt; svec;
    string lines;
    string dataname =&quot;test.txt&quot;;
    source.open(dataname.c_str());
    if (!source)
    {
        cerr &lt;&lt; dataname
             &lt;&lt; &quot; not found\n&quot;;
        return-1;
    }

    while (getline(source,lines))
    {

        svec.push_back(lines);

    }
    for (vector&lt;string&gt;::size_type index = 0; index!=svec.size(); ++index)
    {

        multistarter(svec[index]);

    }

}
</code></pre>
<p>in der test datei steht immoment</p>
<pre><code class="language-cpp">firefox.exe, wwww.cplusplus.de
</code></pre>
<p>leider bekomme ich schon einen compiler fehler =&gt;<strong>too few arguments</strong></p>
<p>aber ich habe doch 2 strings in der function ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2117000</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2117000</guid><dc:creator><![CDATA[kantaki]]></dc:creator><pubDate>Thu, 08 Sep 2011 20:50:50 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 21:01:34 GMT]]></title><description><![CDATA[<p>Hm.. wie viele Parameter bekommt &quot;multistarter&quot; und wie viele hast du übergeben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2117003</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2117003</guid><dc:creator><![CDATA[cooky451]]></dc:creator><pubDate>Thu, 08 Sep 2011 21:01:34 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 21:05:46 GMT]]></title><description><![CDATA[<p>cooky451 schrieb:</p>
<blockquote>
<p>Hm.. wie viele Parameter bekommt &quot;multistarter&quot; und wie viele hast du übergeben?</p>
</blockquote>
<pre><code class="language-cpp">void multistarter( string exename, string site ) // 2 string arguments
</code></pre>
<p>und gelesen wird firefox.exe, <a href="http://wwww.cplusplus.de" rel="nofollow">wwww.cplusplus.de</a></p>
<p>aber irgentwie übersehe ich irgentwas. aber ich finde es nicht. vielleicht sollte ich heute einfach mal pause machen und mir das programm morgen nochmal anschauen T_T.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2117006</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2117006</guid><dc:creator><![CDATA[kantaki]]></dc:creator><pubDate>Thu, 08 Sep 2011 21:05:46 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 21:17:15 GMT]]></title><description><![CDATA[<p>kantaki schrieb:</p>
<blockquote>
<p>cooky451 schrieb:</p>
<blockquote>
<p>Hm.. wie viele Parameter bekommt &quot;multistarter&quot; und wie viele hast du übergeben?</p>
</blockquote>
<pre><code class="language-cpp">void multistarter( string exename, string site ) // 2 string arguments
</code></pre>
<p>und gelesen wird firefox.exe, <a href="http://wwww.cplusplus.de" rel="nofollow">wwww.cplusplus.de</a></p>
<p>aber irgentwie übersehe ich irgentwas. aber ich finde es nicht. vielleicht sollte ich heute einfach mal pause machen und mir das programm morgen nochmal anschauen T_T.</p>
</blockquote>
<p>Guck dir doch mal Zeile 47 an? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /><br />
Du solltest einfach die Grundlagen lernen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2117010</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2117010</guid><dc:creator><![CDATA[cooky451]]></dc:creator><pubDate>Thu, 08 Sep 2011 21:17:15 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 21:21:52 GMT]]></title><description><![CDATA[<p>cooky451 schrieb:</p>
<blockquote>
<p>Guck dir doch mal Zeile 47 an? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /><br />
Du solltest einfach die Grundlagen lernen.</p>
</blockquote>
<p>hmm?</p>
<p>multistarter(svec[index]); gibt doch eine zeile von meiner textdatei aus. also in diesem fall firefox.exe, <a href="http://wwww.cplusplus.de" rel="nofollow">wwww.cplusplus.de</a>.</p>
<p>überseh ich etwas ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2117011</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2117011</guid><dc:creator><![CDATA[kantaki]]></dc:creator><pubDate>Thu, 08 Sep 2011 21:21:52 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 21:28:34 GMT]]></title><description><![CDATA[<p>kantaki schrieb:</p>
<blockquote>
<p>multistarter(svec[index]); gibt doch eine zeile von meiner textdatei aus. also in diesem fall firefox.exe, <a href="http://wwww.cplusplus.de" rel="nofollow">wwww.cplusplus.de</a>.</p>
<p>überseh ich etwas ?</p>
</blockquote>
<p>cooky451 schrieb:</p>
<blockquote>
<p>Hm.. wie viele Parameter bekommt &quot;multistarter&quot; und wie viele hast du übergeben?</p>
</blockquote>
<p>Alles dreht sich irgendwie im Kreis.</p>
<p>P.S.: C++ ist übrigens keine Skriptsprache. Falls du glaubst dies hier ginge, dann irrst du dich gewaltig:</p>
<pre><code class="language-cpp">void foo(int, int);

int main()
{
 int a, b;
 string argument = &quot;a, b&quot;;
 foo(argument);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2117013</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2117013</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Thu, 08 Sep 2011 21:28:34 GMT</pubDate></item><item><title><![CDATA[Reply to system() + string möglich ? on Thu, 08 Sep 2011 22:06:07 GMT]]></title><description><![CDATA[<p>hm okay dh ich muss jedes wort trennen und einer variable zuweisen. müsste doch machbar sein. naja jedenfalls danke schonmal. ich setzte mich morgen nochmal dran.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2117031</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2117031</guid><dc:creator><![CDATA[kantaki]]></dc:creator><pubDate>Thu, 08 Sep 2011 22:06:07 GMT</pubDate></item></channel></rss>