<?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[Fehler in Priemzahlenprogramm]]></title><description><![CDATA[<p>Hi!<br />
ich hab heute ein Proemzahlen programm geschrieben, was mir eigentlich alle priemzahlen in einem bestimten zahlen raum anzeigen soll...leider funktioniert es nicht...ich hab schon ganz viele dinge verändert und es geht immernochnicht.<br />
Wo liegt der fehler?</p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
using namespace std;

int main()
{
int priemzahl;
priemzahl=1;
int oft;
float testfloat;
int test;
int schleifenzahl;
float teilzahl;
cout&lt;&lt;&quot;Wieviele Primzahlen sollen Angezeigt werden?\n\a&quot;;
cin&gt;&gt;oft;
for(int wieder=0;wieder&lt;oft;wieder=wieder+1)
{
        priemzahl=priemzahl+1;
       schleifenzahl=0;
 teilzahl=0;
        for(int i=1;teilzahl&lt;priemzahl;i=i+1)   
        {
                teilzahl=teilzahl+1;
                testfloat=priemzahl/teilzahl;
                test=testfloat;

                if(test==testfloat)
                {}
                else
                {
                    cout&lt;&lt;priemzahl&lt;&lt;&quot; | &quot;;
                    teilzahl=priemzahl;
                    i=0;

                }
        }
}

cin.get();
cin.get();

}
</code></pre>
<p>Achso: und bitte nicht mit irgendwelchen spezial funktionen kommen <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 />
ich möchte das gerne mit eminer methode lösen (ausnutzen vom gleichsetzen von integer und float)</p>
<p>danke schonmal gruß<br />
thebaboon</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/213362/fehler-in-priemzahlenprogramm</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 07:21:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/213362.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 16 May 2008 21:04:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Fri, 16 May 2008 21:41:23 GMT]]></title><description><![CDATA[<p>Hi!<br />
ich hab heute ein Proemzahlen programm geschrieben, was mir eigentlich alle priemzahlen in einem bestimten zahlen raum anzeigen soll...leider funktioniert es nicht...ich hab schon ganz viele dinge verändert und es geht immernochnicht.<br />
Wo liegt der fehler?</p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
using namespace std;

int main()
{
int priemzahl;
priemzahl=1;
int oft;
float testfloat;
int test;
int schleifenzahl;
float teilzahl;
cout&lt;&lt;&quot;Wieviele Primzahlen sollen Angezeigt werden?\n\a&quot;;
cin&gt;&gt;oft;
for(int wieder=0;wieder&lt;oft;wieder=wieder+1)
{
        priemzahl=priemzahl+1;
       schleifenzahl=0;
 teilzahl=0;
        for(int i=1;teilzahl&lt;priemzahl;i=i+1)   
        {
                teilzahl=teilzahl+1;
                testfloat=priemzahl/teilzahl;
                test=testfloat;

                if(test==testfloat)
                {}
                else
                {
                    cout&lt;&lt;priemzahl&lt;&lt;&quot; | &quot;;
                    teilzahl=priemzahl;
                    i=0;

                }
        }
}

cin.get();
cin.get();

}
</code></pre>
<p>Achso: und bitte nicht mit irgendwelchen spezial funktionen kommen <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 />
ich möchte das gerne mit eminer methode lösen (ausnutzen vom gleichsetzen von integer und float)</p>
<p>danke schonmal gruß<br />
thebaboon</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1510785</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1510785</guid><dc:creator><![CDATA[thebaboon]]></dc:creator><pubDate>Fri, 16 May 2008 21:41:23 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Fri, 16 May 2008 21:20:53 GMT]]></title><description><![CDATA[<p>1. Lerne, wie man Primzahl schreibt.</p>
<p>2. Das ist nicht so banal, wie du denkst.</p>
<p>3. cpp - Tags benutzen</p>
<p>4. <a href="http://www.madeasy.de/2/prgsieb.htm" rel="nofollow">Das</a> (oder andere Erläuterungen) lesen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1510795</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1510795</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Fri, 16 May 2008 21:20:53 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 05:07:07 GMT]]></title><description><![CDATA[<p>thebaboon schrieb:</p>
<blockquote>
<p>... ein Proemzahlen programm geschrieben, ... alle priemzahlen<br />
[/cpp]</p>
</blockquote>
<p>Was sind denn das für neue Zahlen??? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1510853</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1510853</guid><dc:creator><![CDATA[*D*]]></dc:creator><pubDate>Sat, 17 May 2008 05:07:07 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 05:14:19 GMT]]></title><description><![CDATA[<p>thebaboon schrieb:</p>
<blockquote>
<p>ich möchte das gerne mit eminer methode lösen (ausnutzen vom gleichsetzen von integer und float)</p>
</blockquote>
<p>Das ist nicht so gut, wegen der Rundungsfehler bei floats.</p>
<p>Und eine Zahl ist noch <strong>nicht</strong> eine Pröhmzähl, weil sie sich <strong>einmal</strong> nicht ohne Rest durch eine Zahl teilen lässt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1510854</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1510854</guid><dc:creator><![CDATA[babarumbabaraba]]></dc:creator><pubDate>Sat, 17 May 2008 05:14:19 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 09:54:06 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include&lt;iostream&gt;
using namespace std;

int main()
{
   int   priemzahl = 1;
   int   oft;
   int   test;
   int   schleifenzahl;
   float teilzahl;
   float testfloat;

   cout &lt;&lt; &quot;Wieviele Primzahlen sollen Angezeigt werden?\n\a&quot;;
   cin &gt;&gt; oft;

   int i;     // in einer schleife deklariert man eine variable immer wieder neu... !

   for(int wieder = 0; wieder &lt; oft; ++wieder)
   {
        ++priemzahl;
        schleifenzahl = 0;
        teilzahl = 0;

        for(i = 1; teilzahl &lt; priemzahl; ++i)  
        {
              ++teilzahl;
              testfloat /= teilzahl;
              test = testfloat;

              if( test != testfloat )
              {
                    cout &lt;&lt; priem zahl &lt;&lt;&quot; | &quot;;
                    teilzahl = priemzahl;
                    i = 0;
              }
        }
   }

   cin.get();
   cin.get();

}
</code></pre>
<p>so sieht das shcon mal etwas besser aus...<br />
(keine bzw nur minimalste änderungen...)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1510923</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1510923</guid><dc:creator><![CDATA[Skym0sh0]]></dc:creator><pubDate>Sat, 17 May 2008 09:54:06 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 18:46:53 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include&lt;iostream&gt;
using namespace std;

int main()
{
   long   priemzahl = 1;
   long   oft;
   long   test;
   float teilzahl;
   float testfloat;

   cout &lt;&lt; &quot;Anzeige aller Priemzahlen im Zahlenraum von 1 bis:\n\a&quot;;
   cin &gt;&gt; oft;

   long i;     // in einer schleife deklariert man eine variable immer wieder neu... !
cout&lt;&lt;&quot;\n1 | &quot;;
   for(long wieder = 0; wieder &lt; oft; ++wieder)
   {
        ++priemzahl;
        teilzahl = 1;
        int fehler;
        fehler = 0;
              int durchlauf;
              durchlauf = 0;
              //cout&lt;&lt;&quot;\n\n------------------------------&lt;&lt;&gt;&gt;------------------------------\n&quot;;
        for(i = 0; fehler != 1; ++i)  
        {

              ++durchlauf;
              ++teilzahl;
              //cout&lt;&lt;&quot;&lt;--&gt;&lt;--&gt;&lt;--&gt;&lt;--&gt;&lt;--&gt;\n&quot;;
              //cout&lt;&lt;durchlauf&lt;&lt;&quot;&lt;--- durchlauf\n&quot;;
              //cout&lt;&lt;teilzahl&lt;&lt;&quot;&lt;---teilzahl\n&quot;;
              //cout&lt;&lt;priemzahl&lt;&lt;&quot;&lt;---priemzahl\n&quot;;
              testfloat = priemzahl/teilzahl;
              //cout&lt;&lt;testfloat&lt;&lt;&quot;&lt;--- Testfloat\n&quot;;
              test = testfloat;
              //cout&lt;&lt;test&lt;&lt;&quot;&lt;--- Test\n&quot;;
              //cout&lt;&lt;fehler&lt;&lt;&quot;&lt;--- Fehler\n\n&quot;;
                            if( priemzahl == teilzahl &amp;&amp; priemzahl &lt;= oft)
              {
                  cout &lt;&lt; priemzahl &lt;&lt;&quot; | &quot;;
                                      fehler = 1;  
                  }    
                            if( test == testfloat )
              {

                    fehler = 1;
              }

        }
          //cout&lt;&lt;&quot;\n\n------------------------------&lt;&lt;&gt;&gt;------------------------------\n&quot;;
   }

   cin.get();
   cin.get();

}
</code></pre>
<p>jetzt funzt es...<br />
abber wie kann ich die gesammte ausgabe in eine textdatei speichern?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511162</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511162</guid><dc:creator><![CDATA[thebaboon]]></dc:creator><pubDate>Sat, 17 May 2008 18:46:53 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 18:49:55 GMT]]></title><description><![CDATA[<p>such mal nach fstream <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="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511165</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511165</guid><dc:creator><![CDATA[darthdespotism]]></dc:creator><pubDate>Sat, 17 May 2008 18:49:55 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 18:51:31 GMT]]></title><description><![CDATA[<p>Beim Aufruf des Programms aus der Konsole:</p>
<pre><code>programm-name &gt; datei-name.txt
</code></pre>
<p>Oder du benutzt Filestreams (std::fstream).</p>
<p>Gruß<br />
Don06</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511168</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511168</guid><dc:creator><![CDATA[Don06]]></dc:creator><pubDate>Sat, 17 May 2008 18:51:31 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 18:58:49 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">fstream datei;
datei.open(&quot;MeineTextDatei.txt&quot;, ios::out);
datei&lt;&lt;&quot;BLA BLA BLUBB&quot;

datei.close();
</code></pre>
<p>Ps.<br />
Mein Primzahlen Programm</p>
<pre><code class="language-cpp">int main()
    {
        Anfang:
        int i;
        int a;
        cout&lt;&lt;&quot;Von wo an sollen die Primzahlen Berechnet werden?  &quot;;
        cin&gt;&gt;i;
        cout&lt;&lt;&quot;\n&quot;;
        cout&lt;&lt;&quot;Bis wohin sollen die primzahlen berechnet werden (max.4294967295)?   &quot;;
        cin&gt;&gt;a;
        cout&lt;&lt;&quot;\n&quot;;

        for(i;i&lt;a;i=++i)
        {
            bool isprim=true;
            for(int j=2;j&lt;i;++j)
            {
                if(i%j==0) { isprim=false;  break;}
            }

                if(isprim) { cout&lt;&lt;&quot;Primzahl: &quot;&lt;&lt;i&lt;&lt;&quot;\t&quot;;}
        }
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1511172</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511172</guid><dc:creator><![CDATA[Matyr]]></dc:creator><pubDate>Sat, 17 May 2008 18:58:49 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 19:57:00 GMT]]></title><description><![CDATA[<p>danke...</p>
<p>abber wenn ichs jetzt so mach:</p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
using namespace std;

int main()
{
   long   priemzahl = 1;
   long   oft;
   long   test;
   float teilzahl;
   float testfloat;

   cout &lt;&lt; &quot;Anzeige aller Priemzahlen im Zahlenraum von 1 bis:\n\a&quot;;
   cin &gt;&gt; oft;

   long i;     // in einer schleife deklariert man eine variable immer wieder neu... !
cout&lt;&lt;&quot;\n1 | &quot;;
   for(long wieder = 0; wieder &lt; oft; ++wieder)
   {
        ++priemzahl;
        teilzahl = 1;
        int fehler;
        fehler = 0;
              int durchlauf;
              durchlauf = 0;
              //cout&lt;&lt;&quot;\n\n------------------------------&lt;&lt;&gt;&gt;------------------------------\n&quot;;
        for(i = 0; fehler != 1; ++i)  
        {

              ++durchlauf;
              ++teilzahl;
              //cout&lt;&lt;&quot;&lt;--&gt;&lt;--&gt;&lt;--&gt;&lt;--&gt;&lt;--&gt;\n&quot;;
              //cout&lt;&lt;durchlauf&lt;&lt;&quot;&lt;--- durchlauf\n&quot;;
              //cout&lt;&lt;teilzahl&lt;&lt;&quot;&lt;---teilzahl\n&quot;;
              //cout&lt;&lt;priemzahl&lt;&lt;&quot;&lt;---priemzahl\n&quot;;
              testfloat = priemzahl/teilzahl;
              //cout&lt;&lt;testfloat&lt;&lt;&quot;&lt;--- Testfloat\n&quot;;
              test = testfloat;
              //cout&lt;&lt;test&lt;&lt;&quot;&lt;--- Test\n&quot;;
              //cout&lt;&lt;fehler&lt;&lt;&quot;&lt;--- Fehler\n\n&quot;;
                            if( priemzahl == teilzahl &amp;&amp; priemzahl &lt;= oft)
              {
fstream datei;
datei.open(&quot;priemzahlen.txt&quot;, ios::out);
datei&lt;&lt;priemzahl&lt;&lt;&quot; | &quot;;

datei.close();
                  cout &lt;&lt; priemzahl &lt;&lt;&quot; | &quot;;
                                      fehler = 1;  
                  }    
                            if( test == testfloat )
              {

                    fehler = 1;
              }

        }
          //cout&lt;&lt;&quot;\n\n------------------------------&lt;&lt;&gt;&gt;------------------------------\n&quot;;
   }

   cin.get();
   cin.get();

}
</code></pre>
<p>dann kommt ne fehler meldung &quot;aggregate `std::fstream datei' has incomplete type and cannot be defined &quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511203</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511203</guid><dc:creator><![CDATA[thebaboon]]></dc:creator><pubDate>Sat, 17 May 2008 19:57:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 20:17:52 GMT]]></title><description><![CDATA[<p>#include &lt;fstream&gt; vergessen sry</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511211</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511211</guid><dc:creator><![CDATA[Matyr]]></dc:creator><pubDate>Sat, 17 May 2008 20:17:52 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 20:30:56 GMT]]></title><description><![CDATA[<p>jetzt kommt:</p>
<pre><code class="language-cpp">#include&lt;iostream&gt;
#include &lt;fstream&gt;
using namespace std;

int main()
{
   long   priemzahl = 1;
   long   oft;
   long   test;
   float teilzahl;
   float testfloat;

   cout &lt;&lt; &quot;Anzeige aller Priemzahlen im Zahlenraum von 1 bis:\n\a&quot;;
   cin &gt;&gt; oft;

   long i;     // in einer schleife deklariert man eine variable immer wieder neu... !
cout&lt;&lt;&quot;\n1 | &quot;;
   for(long wieder = 0; wieder &lt; oft; ++wieder)
   {
        ++priemzahl;
        teilzahl = 1;
        int fehler;
        fehler = 0;
              int durchlauf;
              durchlauf = 0;
              //cout&lt;&lt;&quot;\n\n------------------------------&lt;&lt;&gt;&gt;------------------------------\n&quot;;
        for(i = 0; fehler != 1; ++i)  
        {

              ++durchlauf;
              ++teilzahl;
              //cout&lt;&lt;&quot;&lt;--&gt;&lt;--&gt;&lt;--&gt;&lt;--&gt;&lt;--&gt;\n&quot;;
              //cout&lt;&lt;durchlauf&lt;&lt;&quot;&lt;--- durchlauf\n&quot;;
              //cout&lt;&lt;teilzahl&lt;&lt;&quot;&lt;---teilzahl\n&quot;;
              //cout&lt;&lt;priemzahl&lt;&lt;&quot;&lt;---priemzahl\n&quot;;
              testfloat = priemzahl/teilzahl;
              //cout&lt;&lt;testfloat&lt;&lt;&quot;&lt;--- Testfloat\n&quot;;
              test = testfloat;
              //cout&lt;&lt;test&lt;&lt;&quot;&lt;--- Test\n&quot;;
              //cout&lt;&lt;fehler&lt;&lt;&quot;&lt;--- Fehler\n\n&quot;;
                            if( priemzahl == teilzahl &amp;&amp; priemzahl &lt;= oft)
              {
fstream datei;
datei.open(&quot;priemzahlen.txt&quot;, ios::out);
datei&lt;&lt;priemzahl&lt;&lt;&quot; | &quot;;

datei.close();
                  cout &lt;&lt; priemzahl &lt;&lt;&quot; | &quot;;
                                      fehler = 1;  
                  }    
                            if( test == testfloat )
              {

                    fehler = 1;
              }

        }
          //cout&lt;&lt;&quot;\n\n------------------------------&lt;&lt;&gt;&gt;------------------------------\n&quot;;
   }

   cin.get();
   cin.get();

}
</code></pre>
<blockquote>
<p>Permission denied</p>
</blockquote>
<blockquote>
<p>ld returned 1 exit status</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1511217</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511217</guid><dc:creator><![CDATA[thebaboon]]></dc:creator><pubDate>Sat, 17 May 2008 20:30:56 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 21:28:12 GMT]]></title><description><![CDATA[<p>Hast du Zugriff auf die Datei?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511251</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511251</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sat, 17 May 2008 21:28:12 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 22:03:05 GMT]]></title><description><![CDATA[<p>was meinst du mit zugriff?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511266</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511266</guid><dc:creator><![CDATA[thebaboon]]></dc:creator><pubDate>Sat, 17 May 2008 22:03:05 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 22:19:06 GMT]]></title><description><![CDATA[<p>Ist sie schreibgeschützt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511270</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511270</guid><dc:creator><![CDATA[SirForce]]></dc:creator><pubDate>Sat, 17 May 2008 22:19:06 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 22:39:38 GMT]]></title><description><![CDATA[<p>SirForce schrieb:</p>
<blockquote>
<p>Ist sie schreibgeschützt?</p>
</blockquote>
<p>Exakt. Und Willkommen, falls du der bist, für den ich dich halte. <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="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511274</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511274</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sat, 17 May 2008 22:39:38 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 22:42:08 GMT]]></title><description><![CDATA[<p>naja...sie existiert ja noch garnicht, weil ich das programm ja nochnicht ausführen konnte</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511277</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511277</guid><dc:creator><![CDATA[thebaboon]]></dc:creator><pubDate>Sat, 17 May 2008 22:42:08 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 22:48:46 GMT]]></title><description><![CDATA[<p>Wie siehts mit ofstream aus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1511279</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511279</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sat, 17 May 2008 22:48:46 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 22:55:03 GMT]]></title><description><![CDATA[<p>tut mir leid...ich programmiere seit 2 tagen in c <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="😃"
    /><br />
könntest du mir kurz einmal sagen was offstream ist? <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>
]]></description><link>https://www.c-plusplus.net/forum/post/1511281</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511281</guid><dc:creator><![CDATA[thebaboon]]></dc:creator><pubDate>Sat, 17 May 2008 22:55:03 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 22:58:02 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include&lt;iostream&gt;
using namespace std;

int main()
{
   int   priemzahl = 1;
   int   oft;
   int   test;
   int   schleifenzahl;
   float teilzahl;
   float testfloat;

   cout &lt;&lt; &quot;Wieviele Primzahlen sollen Angezeigt werden?\n\a&quot;;
   cin &gt;&gt; oft;

   int i;     // in einer schleife deklariert man eine variable immer wieder neu... !

   for(int wieder = 0; wieder &lt; oft; ++wieder)
   {
        ++priemzahl;
        schleifenzahl = 0;
        teilzahl = 0;

        for(i = 1; teilzahl &lt; priemzahl; ++i)  
        {
              ++teilzahl;
              testfloat /= teilzahl;
              test = testfloat;

              if( test != testfloat )
              {
                  fstream datei;
                  datei.open(&quot;priemzahlen.txt&quot;, ios::out);
                  datei&lt;&lt;priemzahl&lt;&lt;&quot; | &quot;;

                  datei.close();
                    cout &lt;&lt; priemzahl &lt;&lt;&quot; | &quot;;
                    teilzahl = priemzahl;
                    i = 0;
              }
        }
   }

   cin.get();
   cin.get();

}
</code></pre>
<p>so siehts jetzt aus</p>
<p>Fehlermeldung;:</p>
<blockquote>
<p>32 C:\Dokumente und Einstellungen\Admin\Eigene Dateien\Geschäft\Unkommerziell\cplusplus\priemzahlentester2.cpp aggregate `std::fstream datei' has incomplete type and cannot be defined</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1511283</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511283</guid><dc:creator><![CDATA[thebaboon]]></dc:creator><pubDate>Sat, 17 May 2008 22:58:02 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler in Priemzahlenprogramm on Sat, 17 May 2008 23:08:22 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;fstream&gt;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1511286</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1511286</guid><dc:creator><![CDATA[drakon]]></dc:creator><pubDate>Sat, 17 May 2008 23:08:22 GMT</pubDate></item></channel></rss>