<?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[Lotto Programm erstellen, HILFE!!!]]></title><description><![CDATA[<p>Hi,<br />
erst ma nen cooles Forum habt ihr hier....hier könnte ich mirs gemütlich machen <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>Spass bei Seite.<br />
Hab vollgendes Problem.<br />
Wir haben als Projekt aufbekommen ein Programm zu schreiben welches eine Lottoreihe mit einer ganzen Tippreihe vergelichen soll. Bis hierhin ja noch einfach....aber die Lottoreihen (10 an der Zahl) sollen in ne Datei geschrieben werden. das funzt auch prima, nur beim auslesen zeigt er scheisse an...</p>
<p>vielleicht könnt ihr mir helfen...plz</p>
<pre><code>case 2:{

    ifstream examplefile (&quot;tippreihen.txt&quot;);
    if (! examplefile.is_open())
    { cout &lt;&lt; &quot;Error opening file! &quot;; system(&quot;PAUSE&quot;);exit (1); }

    while (! examplefile.eof())
    {
          examplefile.getline (buffer,600);
          //cout &lt;&lt; buffer &lt;&lt; endl;

                       for (int aa=0; aa&lt;6; aa++)
                             {
                                 for (int ab=0; ab&lt;10; ab++)
                                  {
                                      feld[aa][ab]=(int)buffer;
                                // a1=feld[aa][ab];
                                 //cout&lt;&lt;a1;
                                  }
                                }
                                }
  // cout &lt;&lt;&quot;-----------------------------------&quot;&lt;&lt;endl;
   //cout &lt;&lt;&quot; 1\t 2\t 3\t 4\t 5\t 6\n&quot;;
   //cout &lt;&lt;&quot;-----------------------------------&quot;&lt;&lt;endl;
 for (int aa=0; aa&lt;6; aa++)
     {
          cout &lt;&lt;&quot; &quot;&lt;&lt;aa+1&lt;&lt;&quot; &quot;;
               for (int ab=0; ab&lt;10; ab++)
                  {
                          cout &lt;&lt;&quot; \t &quot;&lt;&lt;feld [aa][ab];
                         }
                     cout &lt;&lt;&quot;\n&quot;;
     }

           //cout &lt;&lt;&quot;Ihre Zahlen der &quot;&lt;&lt;a3+1&lt;&lt;&quot;. Zeile sind: &quot;&lt;&lt;buffer ;
}
break;
</code></pre>
<p>Das auskommentierte is erst ma Wurst. Die Textdatei in der die Zahlen sind heisst Tippreihen.txt und beinhaltet 600 Zahlen untereinander...</p>
<p><a href="http://kuh-design.cwsurf.de/img/lotto.gif" rel="nofollow">Hier sieht man das malör</a></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/129788/lotto-programm-erstellen-hilfe</link><generator>RSS for Node</generator><lastBuildDate>Wed, 26 Aug 2026 15:28:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/129788.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 16 Dec 2005 16:29:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Lotto Programm erstellen, HILFE!!! on Fri, 16 Dec 2005 16:29:46 GMT]]></title><description><![CDATA[<p>Hi,<br />
erst ma nen cooles Forum habt ihr hier....hier könnte ich mirs gemütlich machen <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>Spass bei Seite.<br />
Hab vollgendes Problem.<br />
Wir haben als Projekt aufbekommen ein Programm zu schreiben welches eine Lottoreihe mit einer ganzen Tippreihe vergelichen soll. Bis hierhin ja noch einfach....aber die Lottoreihen (10 an der Zahl) sollen in ne Datei geschrieben werden. das funzt auch prima, nur beim auslesen zeigt er scheisse an...</p>
<p>vielleicht könnt ihr mir helfen...plz</p>
<pre><code>case 2:{

    ifstream examplefile (&quot;tippreihen.txt&quot;);
    if (! examplefile.is_open())
    { cout &lt;&lt; &quot;Error opening file! &quot;; system(&quot;PAUSE&quot;);exit (1); }

    while (! examplefile.eof())
    {
          examplefile.getline (buffer,600);
          //cout &lt;&lt; buffer &lt;&lt; endl;

                       for (int aa=0; aa&lt;6; aa++)
                             {
                                 for (int ab=0; ab&lt;10; ab++)
                                  {
                                      feld[aa][ab]=(int)buffer;
                                // a1=feld[aa][ab];
                                 //cout&lt;&lt;a1;
                                  }
                                }
                                }
  // cout &lt;&lt;&quot;-----------------------------------&quot;&lt;&lt;endl;
   //cout &lt;&lt;&quot; 1\t 2\t 3\t 4\t 5\t 6\n&quot;;
   //cout &lt;&lt;&quot;-----------------------------------&quot;&lt;&lt;endl;
 for (int aa=0; aa&lt;6; aa++)
     {
          cout &lt;&lt;&quot; &quot;&lt;&lt;aa+1&lt;&lt;&quot; &quot;;
               for (int ab=0; ab&lt;10; ab++)
                  {
                          cout &lt;&lt;&quot; \t &quot;&lt;&lt;feld [aa][ab];
                         }
                     cout &lt;&lt;&quot;\n&quot;;
     }

           //cout &lt;&lt;&quot;Ihre Zahlen der &quot;&lt;&lt;a3+1&lt;&lt;&quot;. Zeile sind: &quot;&lt;&lt;buffer ;
}
break;
</code></pre>
<p>Das auskommentierte is erst ma Wurst. Die Textdatei in der die Zahlen sind heisst Tippreihen.txt und beinhaltet 600 Zahlen untereinander...</p>
<p><a href="http://kuh-design.cwsurf.de/img/lotto.gif" rel="nofollow">Hier sieht man das malör</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/943679</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/943679</guid><dc:creator><![CDATA[Henus]]></dc:creator><pubDate>Fri, 16 Dec 2005 16:29:46 GMT</pubDate></item><item><title><![CDATA[Reply to Lotto Programm erstellen, HILFE!!! on Sat, 17 Dec 2005 02:15:10 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile.php?mode=viewprofile&amp;u=4180" rel="nofollow">Korbinian</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=11" rel="nofollow">Projekte</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum.php?f=15" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/944030</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/944030</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Sat, 17 Dec 2005 02:15:10 GMT</pubDate></item><item><title><![CDATA[Reply to Lotto Programm erstellen, HILFE!!! on Sat, 17 Dec 2005 13:35:42 GMT]]></title><description><![CDATA[<p>Henus schrieb:</p>
<blockquote>
<p>Das auskommentierte is erst ma Wurst. Die Textdatei in der die Zahlen sind heisst Tippreihen.txt und beinhaltet 600 Zahlen untereinander...</p>
</blockquote>
<p>Warum ließt du dann 600 Zeichen pro <em>Zeile</em>? Außerdem: warum ließt du, wenn in der Txt-Datei Zahlen stehen, diese erst als String ein und konvertierst diese danach falsch in Ganzzahlen?</p>
<p>Beispiel wie du sehr einfach Zahlen aus einer Datei einlesen kannst:</p>
<pre><code class="language-cpp">#include &lt;fstream&gt;
#include &lt;iostream&gt;

int main(int argc, char* argv[])
{
     if(argc != 2)
        return 1;

     std::ifstream in(argv[1]);
     int feld[60] = { };
     if(in)
     {
          for(size_t i = 0, end = sizeof(feld) / sizeof(int); in.good() &amp;&amp; i &lt; end; ++i)
               in &gt;&gt; feld[i];
     }
     // Zeug steht jetzt in feld.
     ...
}
</code></pre>
<p>Gruß Caipi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/944289</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/944289</guid><dc:creator><![CDATA[Caipi]]></dc:creator><pubDate>Sat, 17 Dec 2005 13:35:42 GMT</pubDate></item><item><title><![CDATA[Reply to Lotto Programm erstellen, HILFE!!! on Sat, 17 Dec 2005 20:15:31 GMT]]></title><description><![CDATA[<p>thx, aber ich hab noch nen paar Fragen, erst ma, die Datei aus der Ausgelesen werden soll wird doch ganz normal mit</p>
<pre><code class="language-cpp">ifstream examplefile (&quot;tippreihen.txt&quot;);
</code></pre>
<p>oder?</p>
<p>und wie muss ich das verändern um ein zweidimensionales Feld daraus zu erstellen?!? Währe echt gut wenn ihr mir helfen könntet...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/944501</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/944501</guid><dc:creator><![CDATA[Henus]]></dc:creator><pubDate>Sat, 17 Dec 2005 20:15:31 GMT</pubDate></item><item><title><![CDATA[Reply to Lotto Programm erstellen, HILFE!!! on Sat, 17 Dec 2005 21:08:58 GMT]]></title><description><![CDATA[<p>Henus schrieb:</p>
<blockquote>
<p>thx, aber ich hab noch nen paar Fragen, erst ma, die Datei aus der Ausgelesen werden soll wird doch ganz normal mit</p>
<pre><code class="language-cpp">ifstream examplefile (&quot;tippreihen.txt&quot;);
</code></pre>
<p>oder?</p>
</blockquote>
<p>Jup. Kannst du. (Das Beispiel von mir bezog sich nicht auf deinen Code, sondern sollte vielmehr das Prinzip verdeutlichen).</p>
<blockquote>
<p>und wie muss ich das verändern um ein zweidimensionales Feld daraus zu erstellen?!? Währe echt gut wenn ihr mir helfen könntet...</p>
</blockquote>
<p>Einfach aus der einen Schleife zwei Schleifen machen, oder aber die eine Schleife wie folgt anpassen:</p>
<p>Beispiel:</p>
<pre><code class="language-cpp">for(size_t i = 0; j = 0; in.good() &amp;&amp; i &lt; 6; ) // erste Array-Dimension als Abbruchbedingung
{
    in &gt;&gt; feld[i][j];
    if(++j &gt;= 10) // Wert der zweiten Array-Dimension hier ggf. anpassen
    {
        j = 0; ++i;
    }
}
</code></pre>
<p>oder, oder... Es gibt viele Möglichkeiten...</p>
<p>Gruß Caipi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/944533</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/944533</guid><dc:creator><![CDATA[Caipi]]></dc:creator><pubDate>Sat, 17 Dec 2005 21:08:58 GMT</pubDate></item><item><title><![CDATA[Reply to Lotto Programm erstellen, HILFE!!! on Sun, 18 Dec 2005 10:55:29 GMT]]></title><description><![CDATA[<p>Super, thx. Nur noch ne Frage, was is das in.good? was macht es, und muss ich es deklarieren?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/944710</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/944710</guid><dc:creator><![CDATA[Henus]]></dc:creator><pubDate>Sun, 18 Dec 2005 10:55:29 GMT</pubDate></item><item><title><![CDATA[Reply to Lotto Programm erstellen, HILFE!!! on Sun, 18 Dec 2005 11:35:20 GMT]]></title><description><![CDATA[<p>Henus schrieb:</p>
<blockquote>
<p>Super, thx. Nur noch ne Frage, was is das in.good? was macht es, und muss ich es deklarieren?</p>
</blockquote>
<p>Infos zu ios::good(): <a href="http://www.cppreference.com/cppio/good.html" rel="nofollow">[1]</a> <a href="http://www.cplusplus.com/ref/iostream/ios/good.html" rel="nofollow">[2]</a>.</p>
<p>Gruß Caipi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/944733</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/944733</guid><dc:creator><![CDATA[Caipi]]></dc:creator><pubDate>Sun, 18 Dec 2005 11:35:20 GMT</pubDate></item><item><title><![CDATA[Reply to Lotto Programm erstellen, HILFE!!! on Mon, 19 Dec 2005 13:20:57 GMT]]></title><description><![CDATA[<p>Ok, hab den Quelltext überarbeitet....</p>
<p>sieht jetzt so aus:</p>
<pre><code class="language-cpp">case 2:{

    ifstream examplefile (&quot;tippreihen.txt&quot;);
        if(argc != 2)
        //return 1;

     std::ifstream in(argv[1]);
     int feld[60] = { };
     if(in)
     {
          for(size_t i = 0; j = 0; in.good() &amp;&amp; i &lt; 6; )
{
    in &gt;&gt; feld[i][j];
    if(++j &gt;= 10)
    {
        j = 0; ++i;
    }
}
     for (int i=0; i&lt;6; i++)
         {
           for (int k=0; k&lt;10; k++)
               {
                   cout &lt;&lt;feld[i][j];
               }
         }

  // cout &lt;&lt;&quot;-----------------------------------&quot;&lt;&lt;endl;
   //cout &lt;&lt;&quot; 1\t 2\t 3\t 4\t 5\t 6\n&quot;;
   //cout &lt;&lt;&quot;-----------------------------------&quot;&lt;&lt;endl;

}
break;
</code></pre>
<p>Nun kommt beim Compilieren folgender Fehler... 'good' has not benn declared...</p>
<p>Was kann das sein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/945569</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/945569</guid><dc:creator><![CDATA[Henus]]></dc:creator><pubDate>Mon, 19 Dec 2005 13:20:57 GMT</pubDate></item><item><title><![CDATA[Reply to Lotto Programm erstellen, HILFE!!! on Mon, 19 Dec 2005 13:47:26 GMT]]></title><description><![CDATA[<p>Hast du am Annfang den Namespace richtig deklariert?</p>
<p>Wenn nicht...</p>
<pre><code class="language-cpp">// Includes
...
// Namespaces
using namespace std;
...

//Programm
...
</code></pre>
<p>Gruss<br />
Tobi</p>
]]></description><link>https://www.c-plusplus.net/forum/post/945602</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/945602</guid><dc:creator><![CDATA[Tobias Gerg]]></dc:creator><pubDate>Mon, 19 Dec 2005 13:47:26 GMT</pubDate></item><item><title><![CDATA[Reply to Lotto Programm erstellen, HILFE!!! on Mon, 19 Dec 2005 14:56:30 GMT]]></title><description><![CDATA[<p>Joa, hab ich alles richtig... der rest von dem Programm funzt ja auch richtig...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/945655</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/945655</guid><dc:creator><![CDATA[Henus]]></dc:creator><pubDate>Mon, 19 Dec 2005 14:56:30 GMT</pubDate></item><item><title><![CDATA[Reply to Lotto Programm erstellen, HILFE!!! on Wed, 21 Dec 2005 11:03:40 GMT]]></title><description><![CDATA[<p>So, jetzt kommt die meldung <strong>'good' is not a type</strong></p>
<p>Weiss jemand woran das liegt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/946924</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/946924</guid><dc:creator><![CDATA[Henus]]></dc:creator><pubDate>Wed, 21 Dec 2005 11:03:40 GMT</pubDate></item><item><title><![CDATA[Reply to Lotto Programm erstellen, HILFE!!! on Sat, 24 Dec 2005 10:25:49 GMT]]></title><description><![CDATA[<p>Hab jetzt alles überarbeitet, funzt jetzt auch eigentlich.</p>
<p>Vielleicht hat ja jemand noch verbesserungsvorschläge</p>
<pre><code class="language-cpp">case 2:
{
char buffer[3];
anzahl=0;
reihen=10;
fstream lesen (&quot;tippreihen.txt&quot;);
if ( lesen.is_open()) //Datei öffnen
{
for (int i=0;i&lt;10;i++) //Schleife für reihen
{
for (int k=0;k&lt;6;k++) //Schleife für Tipps 1-6
{
lesen.getline (buffer,3); //Zeile in buffer speichern
const char* temp = buffer; //buffer in temp spaichern
tip[k][i] = atof(temp); //temp als double in tip speichern
if (tip[k][i]==0) //Anfang Ende der Tipps herrausfinden
{
i=9;
k=5;
reihen=anzahl/6; //reihen festlegen
}
else
anzahl++; //Ende Ende der Tipps herrausfinden
}
}
lesen.close(); //Datei schließen
}
eingabetip=1; //Wert wichtig für unmögliche Menüeingaben
cout&lt;&lt;&quot;Tipps wurden aus Datei 'tippreihen.txt' gelesen!\n\n&quot;;
cout&lt;&lt;&quot;Bitte Taste druecken...&quot;;
getch();
}
break;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/949065</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/949065</guid><dc:creator><![CDATA[Henus]]></dc:creator><pubDate>Sat, 24 Dec 2005 10:25:49 GMT</pubDate></item><item><title><![CDATA[Reply to Lotto Programm erstellen, HILFE!!! on Sat, 24 Dec 2005 10:41:13 GMT]]></title><description><![CDATA[<p>Henus schrieb:</p>
<blockquote>
<p>Hab jetzt alles überarbeitet, funzt jetzt auch eigentlich.</p>
<p>Vielleicht hat ja jemand noch verbesserungsvorschläge</p>
</blockquote>
<p>Einrücken</p>
]]></description><link>https://www.c-plusplus.net/forum/post/949072</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/949072</guid><dc:creator><![CDATA[Antwort schreiben]]></dc:creator><pubDate>Sat, 24 Dec 2005 10:41:13 GMT</pubDate></item></channel></rss>