<?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[Provlem mit Schleife]]></title><description><![CDATA[<p>Hallo! Ich habe folgendes Pronlem:<br />
Ich möchte zuerst Bedinungen und Werte an eine Schleife ünergeben, welche darauf diese Werte benuzt um z.B. eine bestimmte dauer durchzulaufen. Dieser Prozess sollt aber im Hintergrund ablaufen, sodass man z.B. x neue Schleifen paralell starten kann.<br />
Wer kann mir helfen?<br />
Hier mein Quelltext:</p>
<pre><code>#include &lt;cstdlib&gt;
#include &lt;iostream&gt;
#include &lt;time.h&gt;
#include &lt;windows.h&gt;
#include &lt;winbase.h&gt;
#include &lt;boost/filesystem/operations.hpp&gt;
#include &lt;boost/thread/thread.hpp&gt; 
using namespace std;
long ThreadTwo(long lParam);
long ThreadThree(long lParam);
long ThreadFour(long lParam);

int main(int argc, char *argv[])
{

  boost.thread

   int Haus ;
  int Burg ;
  int Schmiede ;
  int Hof ;
      int stufe[4]={Burg,Schmiede,Hof,Haus}; 
      stufe[0]=0;
      stufe[1]=0;
      stufe[2]=0;
      stufe[3]=0;
  int Haus_t = 60;
  int Burg_t = 40;
  int Schmiede_t = 20;
  int Hof_t = 15;
  int gebaeude[4]={Burg_t,Schmiede_t,Hof_t,Haus_t};
     main:
   int wahl;
cout&lt;&lt;&quot;0. Burg = 40 Sek. Stufe:&quot;&lt;&lt;stufe[0]&lt;&lt;endl;
cout&lt;&lt;&quot;1. Schmiede = 20 Sek. Stufe:&quot;&lt;&lt;stufe[1]&lt;&lt;endl;
cout&lt;&lt;&quot;2. Hof = 15 Sek. Stufe:&quot;&lt;&lt;stufe[2]&lt;&lt;endl;
cout&lt;&lt;&quot;3. Haus = 60 Sek. Stufe:&quot;&lt;&lt;stufe[3]&lt;&lt;endl;

   cin&gt;&gt;wahl;

   if (wahl&lt;3)
   {

   int i;
   int dauer;
   dauer= gebaeude[wahl];

     for(i=1;i&lt;=dauer;i=i+1)
   {
                       int t_left;
                       t_left=dauer-i;
      cout&lt;&lt;t_left&lt;&lt;endl;
      if (i==dauer)
      {

  stufe[wahl]=stufe[wahl]+1;
  goto main;

}

      Sleep(1000);
      system(&quot;cls&quot;);

   };
}
else
 {    system(&quot;cls&quot;);
     goto main;
     }

    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/142713/provlem-mit-schleife</link><generator>RSS for Node</generator><lastBuildDate>Wed, 02 Sep 2026 00:14:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/142713.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 02 Apr 2006 08:20:42 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Provlem mit Schleife on Sun, 02 Apr 2006 08:20:42 GMT]]></title><description><![CDATA[<p>Hallo! Ich habe folgendes Pronlem:<br />
Ich möchte zuerst Bedinungen und Werte an eine Schleife ünergeben, welche darauf diese Werte benuzt um z.B. eine bestimmte dauer durchzulaufen. Dieser Prozess sollt aber im Hintergrund ablaufen, sodass man z.B. x neue Schleifen paralell starten kann.<br />
Wer kann mir helfen?<br />
Hier mein Quelltext:</p>
<pre><code>#include &lt;cstdlib&gt;
#include &lt;iostream&gt;
#include &lt;time.h&gt;
#include &lt;windows.h&gt;
#include &lt;winbase.h&gt;
#include &lt;boost/filesystem/operations.hpp&gt;
#include &lt;boost/thread/thread.hpp&gt; 
using namespace std;
long ThreadTwo(long lParam);
long ThreadThree(long lParam);
long ThreadFour(long lParam);

int main(int argc, char *argv[])
{

  boost.thread

   int Haus ;
  int Burg ;
  int Schmiede ;
  int Hof ;
      int stufe[4]={Burg,Schmiede,Hof,Haus}; 
      stufe[0]=0;
      stufe[1]=0;
      stufe[2]=0;
      stufe[3]=0;
  int Haus_t = 60;
  int Burg_t = 40;
  int Schmiede_t = 20;
  int Hof_t = 15;
  int gebaeude[4]={Burg_t,Schmiede_t,Hof_t,Haus_t};
     main:
   int wahl;
cout&lt;&lt;&quot;0. Burg = 40 Sek. Stufe:&quot;&lt;&lt;stufe[0]&lt;&lt;endl;
cout&lt;&lt;&quot;1. Schmiede = 20 Sek. Stufe:&quot;&lt;&lt;stufe[1]&lt;&lt;endl;
cout&lt;&lt;&quot;2. Hof = 15 Sek. Stufe:&quot;&lt;&lt;stufe[2]&lt;&lt;endl;
cout&lt;&lt;&quot;3. Haus = 60 Sek. Stufe:&quot;&lt;&lt;stufe[3]&lt;&lt;endl;

   cin&gt;&gt;wahl;

   if (wahl&lt;3)
   {

   int i;
   int dauer;
   dauer= gebaeude[wahl];

     for(i=1;i&lt;=dauer;i=i+1)
   {
                       int t_left;
                       t_left=dauer-i;
      cout&lt;&lt;t_left&lt;&lt;endl;
      if (i==dauer)
      {

  stufe[wahl]=stufe[wahl]+1;
  goto main;

}

      Sleep(1000);
      system(&quot;cls&quot;);

   };
}
else
 {    system(&quot;cls&quot;);
     goto main;
     }

    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1028960</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1028960</guid><dc:creator><![CDATA[kreator14_5]]></dc:creator><pubDate>Sun, 02 Apr 2006 08:20:42 GMT</pubDate></item><item><title><![CDATA[Reply to Provlem mit Schleife on Sun, 02 Apr 2006 08:21:36 GMT]]></title><description><![CDATA[<p>wie man sieht habe ich mich schon an Threads versucht, jedoch ohne jeglichen erfolg -.-</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1028961</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1028961</guid><dc:creator><![CDATA[kreator14_5]]></dc:creator><pubDate>Sun, 02 Apr 2006 08:21:36 GMT</pubDate></item><item><title><![CDATA[Reply to Provlem mit Schleife on Sun, 02 Apr 2006 08:57:08 GMT]]></title><description><![CDATA[<p>Lern lieber mal gescheit C++ bevor du dir solche Sachen anschaust. Und EINRÜCKUNGEN! Ist ja eine Qual... Der goto genauso.</p>
<p>Cool-O-Meter |----------| 0/10</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1028973</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1028973</guid><dc:creator><![CDATA[Cool-O-Meter |----------|]]></dc:creator><pubDate>Sun, 02 Apr 2006 08:57:08 GMT</pubDate></item><item><title><![CDATA[Reply to Provlem mit Schleife on Sun, 02 Apr 2006 09:40:33 GMT]]></title><description><![CDATA[<p>es gitb doch immer hilfsbereite, nette menschen... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1028990</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1028990</guid><dc:creator><![CDATA[kreator14_5]]></dc:creator><pubDate>Sun, 02 Apr 2006 09:40:33 GMT</pubDate></item><item><title><![CDATA[Reply to Provlem mit Schleife on Sun, 02 Apr 2006 09:53:41 GMT]]></title><description><![CDATA[<p>Wenn du noch nicht mal schleifen hin bekommst wie willst du dann mit threads fertig werden?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1028998</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1028998</guid><dc:creator><![CDATA[ghfdf]]></dc:creator><pubDate>Sun, 02 Apr 2006 09:53:41 GMT</pubDate></item><item><title><![CDATA[Reply to Provlem mit Schleife on Sun, 02 Apr 2006 09:57:08 GMT]]></title><description><![CDATA[<p>schickt das mal jemand bitte bei <a href="http://thedailywtf.com/" rel="nofollow">http://thedailywtf.com/</a> ein <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="😃"
    /></p>
<p>das kommt bestimmt einen extra platz in der hall of shame <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /></p>
<p>b2t:<br />
ganz ehrlich lern erstmal die grundlagen, zB &quot;aufbau eines c++ programmes&quot; <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1029000</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1029000</guid><dc:creator><![CDATA[immigrant]]></dc:creator><pubDate>Sun, 02 Apr 2006 09:57:08 GMT</pubDate></item><item><title><![CDATA[Reply to Provlem mit Schleife on Sun, 02 Apr 2006 11:03:58 GMT]]></title><description><![CDATA[<p>Das stufe Array ist kühl...</p>
<p>Bye, TGGC (<a href="http://tggc.tg.funpic.de/index.php?cat=1&amp;page=8" rel="nofollow">Fakten</a>)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1029034</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1029034</guid><dc:creator><![CDATA[TGGC]]></dc:creator><pubDate>Sun, 02 Apr 2006 11:03:58 GMT</pubDate></item><item><title><![CDATA[Reply to Provlem mit Schleife on Sun, 02 Apr 2006 11:31:10 GMT]]></title><description><![CDATA[<p>Du solltest statt dem [ code ] tag das [ cpp ] tag benutzen, dann wird's schön bunt. Außerdem musst du dir eine Einrückung angewöhnen!</p>
<p>So ähnlich müsste es aussehen:</p>
<pre><code class="language-cpp">#include &lt;cstdlib&gt;
#include &lt;iostream&gt;
#include &lt;time.h&gt;
#include &lt;windows.h&gt;
#include &lt;winbase.h&gt;
#include &lt;boost/filesystem/operations.hpp&gt;
#include &lt;boost/thread/thread.hpp&gt;
using namespace std;
long ThreadTwo(long lParam);
long ThreadThree(long lParam);
long ThreadFour(long lParam);

int main(int argc, char *argv[])
{
    boost.thread
    int Haus ;
    int Burg ;
    int Schmiede ;
    int Hof ;
    int stufe[4]=
        {
            Burg,Schmiede,Hof,Haus
        };
    stufe[0]=0;
    stufe[1]=0;
    stufe[2]=0;
    stufe[3]=0;
    int Haus_t = 60;
    int Burg_t = 40;
    int Schmiede_t = 20;
    int Hof_t = 15;
    int gebaeude[4]=
        {
            Burg_t,Schmiede_t,Hof_t,Haus_t
        };
main:
    int wahl;
    cout&lt;&lt;&quot;0. Burg = 40 Sek. Stufe:&quot;&lt;&lt;stufe[0]&lt;&lt;endl;
    cout&lt;&lt;&quot;1. Schmiede = 20 Sek. Stufe:&quot;&lt;&lt;stufe[1]&lt;&lt;endl;
    cout&lt;&lt;&quot;2. Hof = 15 Sek. Stufe:&quot;&lt;&lt;stufe[2]&lt;&lt;endl;
    cout&lt;&lt;&quot;3. Haus = 60 Sek. Stufe:&quot;&lt;&lt;stufe[3]&lt;&lt;endl;
    cin&gt;&gt;wahl;
    if (wahl&lt;3)
    {
        int i;
        int dauer;
        dauer= gebaeude[wahl];
        for(i=1;i&lt;=dauer;i=i+1)
        {
            int t_left;
            t_left=dauer-i;
            cout&lt;&lt;t_left&lt;&lt;endl;
            if (i==dauer)
            {
                stufe[wahl]=stufe[wahl]+1;
                goto main;
            }
            Sleep(1000);
            system(&quot;cls&quot;);
        };
    }
    else
    {
        system(&quot;cls&quot;);
        goto main;
    }
    system(&quot;PAUSE&quot;);
    return EXIT_SUCCESS;
}
</code></pre>
<p>Dann kann man deinen Code viel besser lesen.</p>
<p>mfg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1029048</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1029048</guid><dc:creator><![CDATA[joomoo]]></dc:creator><pubDate>Sun, 02 Apr 2006 11:31:10 GMT</pubDate></item><item><title><![CDATA[Reply to Provlem mit Schleife on Sun, 02 Apr 2006 21:13:01 GMT]]></title><description><![CDATA[<p>find ich echt nett von euch das ganze hier...auf anfängerfehlern auf dümmste art un weise rumzuhacken halte ich für eine der dezentesten art und weise negativ aufzufallen! danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1029431</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1029431</guid><dc:creator><![CDATA[kreator14_5]]></dc:creator><pubDate>Sun, 02 Apr 2006 21:13:01 GMT</pubDate></item><item><title><![CDATA[Reply to Provlem mit Schleife on Sun, 02 Apr 2006 22:18:37 GMT]]></title><description><![CDATA[<p>kreator14_5 schrieb:</p>
<blockquote>
<p>find ich echt nett von euch das ganze hier...auf anfängerfehlern auf dümmste art un weise rumzuhacken halte ich für eine der dezentesten art und weise negativ aufzufallen! danke!</p>
</blockquote>
<p>Du lässt dir ja gar nicht helfen oder? Die ganze Zeit nur am meckern aber du gehst nich auf unsere Hilfestellungen ein.<br />
Welchen Compiler benutzt du?</p>
<p>mfg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1029446</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1029446</guid><dc:creator><![CDATA[joomoo]]></dc:creator><pubDate>Sun, 02 Apr 2006 22:18:37 GMT</pubDate></item><item><title><![CDATA[Reply to Provlem mit Schleife on Mon, 03 Apr 2006 05:26:09 GMT]]></title><description><![CDATA[<p>kreator14_5 schrieb:</p>
<blockquote>
<p>find ich echt nett von euch das ganze hier...auf anfängerfehlern auf dümmste art un weise rumzuhacken halte ich für eine der dezentesten art und weise negativ aufzufallen! danke!</p>
</blockquote>
<p>Vielleicht weil die Fehler &quot;auf dümmste art un weise&quot; gemacht wurden?</p>
<p>Bye, TGGC (<a href="http://tggc.tg.funpic.de/index.php?cat=1&amp;page=8" rel="nofollow">Fakten</a>)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1029468</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1029468</guid><dc:creator><![CDATA[TGGC]]></dc:creator><pubDate>Mon, 03 Apr 2006 05:26:09 GMT</pubDate></item><item><title><![CDATA[Reply to Provlem mit Schleife on Mon, 03 Apr 2006 13:59:00 GMT]]></title><description><![CDATA[<p>mister unfehlbar²</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1029694</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1029694</guid><dc:creator><![CDATA[kreator14_5]]></dc:creator><pubDate>Mon, 03 Apr 2006 13:59:00 GMT</pubDate></item><item><title><![CDATA[Reply to Provlem mit Schleife on Mon, 03 Apr 2006 14:18:10 GMT]]></title><description><![CDATA[<p>schau dir mal <a href="http://www.boost.org/doc/html/threads.html" rel="nofollow">http://www.boost.org/doc/html/threads.html</a> an! mit dieser bibilothek kannst du threas realisieren....:)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1029703</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1029703</guid><dc:creator><![CDATA[BorisProgger]]></dc:creator><pubDate>Mon, 03 Apr 2006 14:18:10 GMT</pubDate></item><item><title><![CDATA[Reply to Provlem mit Schleife on Mon, 03 Apr 2006 22:57:53 GMT]]></title><description><![CDATA[<p>kreator14_5 schrieb:</p>
<blockquote>
<p>mister unfehlbar²</p>
</blockquote>
<p>Ja, was gibt es.</p>
<p>Bye, TGGC (<a href="http://tggc.tg.funpic.de/index.php?cat=1&amp;page=8" rel="nofollow">Fakten</a>)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1029962</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1029962</guid><dc:creator><![CDATA[TGGC]]></dc:creator><pubDate>Mon, 03 Apr 2006 22:57:53 GMT</pubDate></item></channel></rss>