<?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[Neuling braucht dringend Hilfe]]></title><description><![CDATA[<p>Hallo allerseits.</p>
<p>Erstmal zur Erklärung:</p>
<p>Ich habe mir für mein Studium zum Teil Java selbst beigebracht, weil ich dachte es dafür zu brauchen. Nun heißt es plötzlich wir müssen schon C++ können. Und bis morgen muss ich eine Programmieraufgabe gelöst haben.<br />
Mir geht es erstmal nur darum den Linker error wegzukriegen, wie gesagt bin Java-Umsteiger und habe keine Ahnung von sowas:</p>
<p># include &lt;iostream&gt;</p>
<p>using namespace std;</p>
<p>void quintary(int i);</p>
<p>main()<br />
{<br />
int Zahl;<br />
int Zahl2;</p>
<p>cout &lt;&lt; &quot;Geben Sie eine Dezimalzahl ein: &quot; &lt;&lt; endl;<br />
cin &gt;&gt; Zahl;<br />
quintary ( Zahl );<br />
{<br />
while ( Zahl != 0 )<br />
{<br />
Zahl = Zahl % 5 ;<br />
Zahl2 = Zahl2 / 5 ;<br />
return Zahl;</p>
<p>}<br />
}</p>
<p>cin.get();<br />
cin.get();<br />
}</p>
<p>Hab natürlich auch gegooglet, aber nichts gefunden was mir hilft. Hoffe auf schnelle Antwort und danke schonmal.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/226050/neuling-braucht-dringend-hilfe</link><generator>RSS for Node</generator><lastBuildDate>Thu, 01 Oct 2026 03:24:10 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/226050.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 28 Oct 2008 16:22:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Neuling braucht dringend Hilfe on Tue, 28 Oct 2008 16:22:36 GMT]]></title><description><![CDATA[<p>Hallo allerseits.</p>
<p>Erstmal zur Erklärung:</p>
<p>Ich habe mir für mein Studium zum Teil Java selbst beigebracht, weil ich dachte es dafür zu brauchen. Nun heißt es plötzlich wir müssen schon C++ können. Und bis morgen muss ich eine Programmieraufgabe gelöst haben.<br />
Mir geht es erstmal nur darum den Linker error wegzukriegen, wie gesagt bin Java-Umsteiger und habe keine Ahnung von sowas:</p>
<p># include &lt;iostream&gt;</p>
<p>using namespace std;</p>
<p>void quintary(int i);</p>
<p>main()<br />
{<br />
int Zahl;<br />
int Zahl2;</p>
<p>cout &lt;&lt; &quot;Geben Sie eine Dezimalzahl ein: &quot; &lt;&lt; endl;<br />
cin &gt;&gt; Zahl;<br />
quintary ( Zahl );<br />
{<br />
while ( Zahl != 0 )<br />
{<br />
Zahl = Zahl % 5 ;<br />
Zahl2 = Zahl2 / 5 ;<br />
return Zahl;</p>
<p>}<br />
}</p>
<p>cin.get();<br />
cin.get();<br />
}</p>
<p>Hab natürlich auch gegooglet, aber nichts gefunden was mir hilft. Hoffe auf schnelle Antwort und danke schonmal.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1606163</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1606163</guid><dc:creator><![CDATA[kojo]]></dc:creator><pubDate>Tue, 28 Oct 2008 16:22:36 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling braucht dringend Hilfe on Tue, 28 Oct 2008 16:34:20 GMT]]></title><description><![CDATA[<p>Du kannst keine Funktion aufrufen, die nur <strong>deklariert</strong> aber noch nicht <strong>definiert</strong> wurde.</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1606169</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1606169</guid><dc:creator><![CDATA[Hausaufgabennichtmacher]]></dc:creator><pubDate>Tue, 28 Oct 2008 16:34:20 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling braucht dringend Hilfe on Tue, 28 Oct 2008 16:36:19 GMT]]></title><description><![CDATA[<p>Was wäre z.B. eine Definition dieser Funktion?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1606172</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1606172</guid><dc:creator><![CDATA[kojo]]></dc:creator><pubDate>Tue, 28 Oct 2008 16:36:19 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling braucht dringend Hilfe on Tue, 28 Oct 2008 16:38:26 GMT]]></title><description><![CDATA[<p>kojo schrieb:</p>
<blockquote>
<p>Was wäre z.B. eine Definition dieser Funktion?</p>
</blockquote>
<p>Naja - das, was die Funktion eben tun soll! (auch &quot;Implementation&quot;/&quot;Implementierung&quot; genannt)<br />
Das ist in Java aber auch nicht anders.</p>
<p>BTW: Bitte &quot;C/C++&quot;-Tags verwenden (siehe Button) - schont unsere Augen und verbessert die Antworten, die Du bekommst.</p>
<p>Gruß,</p>
<p>Simon2.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1606174</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1606174</guid><dc:creator><![CDATA[Simon2]]></dc:creator><pubDate>Tue, 28 Oct 2008 16:38:26 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling braucht dringend Hilfe on Tue, 28 Oct 2008 16:53:08 GMT]]></title><description><![CDATA[<p>kojo schrieb:</p>
<blockquote>
<p>Hallo allerseits.</p>
<p>Erstmal zur Erklärung:</p>
<p>Ich habe mir für mein Studium zum Teil Java selbst beigebracht, weil ich dachte es dafür zu brauchen. Nun heißt es plötzlich wir müssen schon C++ können. Und bis morgen muss ich eine Programmieraufgabe gelöst haben.<br />
Mir geht es erstmal nur darum den Linker error wegzukriegen,<br />
<strong>Wäre gut wenn du den Fehler mal posten würdest (für die Zukunft)</strong><br />
wie gesagt bin Java-Umsteiger und habe keine Ahnung von sowas:</p>
<pre><code class="language-cpp"># include &lt;iostream&gt;

using namespace std;

void quintary(int i);

main()
{
   int Zahl;
   int Zahl2;
   
   cout &lt;&lt; &quot;Geben Sie eine Dezimalzahl ein: &quot; &lt;&lt; endl;
   cin &gt;&gt; Zahl;
   quintary ( Zahl );
   
   while ( Zahl != 0 ){
       Zahl = Zahl % 5 ;
       Zahl2 = Zahl2 / 5 ;    
       return Zahl;
         
             
   }                   
   
  
   
   cin.get();
   cin.get();
}
</code></pre>
<p>Hab natürlich auch gegooglet, aber nichts gefunden was mir hilft. Hoffe auf schnelle Antwort und danke schonmal.</p>
</blockquote>
<p>Was soll dein Programm denn überhaupt machen?<br />
Den FktKopf anzuschreiben nennt man Deklaration</p>
<pre><code class="language-cpp">void quintary(int i);
</code></pre>
<p>Diese Fkt muss dann aber auch definiert werden: (z.B.: )</p>
<pre><code class="language-cpp">void quintary(int i){
    int z=i+1;
}
</code></pre>
<p>Weiter ist das return in deiner Main Fkt total unnütz weil das Programm an der Stelle beendet wird<br />
Zahl2 wird allerdings nie definiert.<br />
Eigentlich ist so ziemlich alles an dem Programm sinnlos.<br />
Daher: Schau dir ein paar Tutorials an.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1606181</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1606181</guid><dc:creator><![CDATA[Kuldren]]></dc:creator><pubDate>Tue, 28 Oct 2008 16:53:08 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling braucht dringend Hilfe on Tue, 28 Oct 2008 16:57:32 GMT]]></title><description><![CDATA[<pre><code class="language-cpp"># include &lt;iostream&gt;

using namespace std;

void quintary(int i);

main()
{
       int Zahl

       cin &gt;&gt; Zahl;
       quintary(Zahl);
}
</code></pre>
<p>Ist vorgegeben als Rahmen, meine Frage ist jetzt WO genau ich die Funktion definieren muss? Es gibt zwar viele Parallelen zu Java ( was ich mir jedoch auch nicht vollständig beibringen konnte, mehr so das Grundgerüst ).<br />
Ein konkretes Beispiel für eine Definition in diesem Rahmen würde mir schon sehr helfen und ich würde aufhören euch zu nerven <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/1606187</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1606187</guid><dc:creator><![CDATA[kojo]]></dc:creator><pubDate>Tue, 28 Oct 2008 16:57:32 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling braucht dringend Hilfe on Tue, 28 Oct 2008 17:00:12 GMT]]></title><description><![CDATA[<p>Danke, das Programm soll eine Dezimalzahl einlesen und als Zahl zur Basis 5 wiedergeben, ohne sich selbst immer wieder aufzurufen. Das mit den Tutorials habe ich vor, aber da ich diese Aufgabe schon morgen abgeben muss, muss ich mich da so irgendwie durchwurschteln.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1606189</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1606189</guid><dc:creator><![CDATA[kojo]]></dc:creator><pubDate>Tue, 28 Oct 2008 17:00:12 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling braucht dringend Hilfe on Tue, 28 Oct 2008 17:12:24 GMT]]></title><description><![CDATA[<p>kojo schrieb:</p>
<blockquote>
<pre><code class="language-cpp"># include &lt;iostream&gt;

using namespace std;

int quintary(int i){
/*

HIER KOMMT DEIN CODE HIN
BAU HIER DEINE AUFGABE EIN

*/
  return ergebnis;
}

int main(int argc, char** argv)
{
       int Zahl;
       cin &gt;&gt; Zahl;
       Zahl=quintary(Zahl);
       cout &lt;&lt;Zahl&lt;&lt;endl;
}
</code></pre>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/1606192</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1606192</guid><dc:creator><![CDATA[Kuldren]]></dc:creator><pubDate>Tue, 28 Oct 2008 17:12:24 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling braucht dringend Hilfe on Tue, 28 Oct 2008 18:19:26 GMT]]></title><description><![CDATA[<p>Danke, Danke!</p>
<p>Ein letztes Mal belästige ich euch noch:</p>
<pre><code class="language-cpp"># include &lt;iostream&gt;

using namespace std;

int quintary(int i){ 
     int gaus = i; 
     int ziffer = i;
     int rest;
     int zahl2;

     while ( gaus != 0 )
     {

     zahl2 = gaus / 5;  
     rest = gaus % 5;
     cout &lt;&lt; rest ;

     gaus = zahl2;
     }

}     
int main()
{

   int Zahl;
   cin &gt;&gt; Zahl;
   Zahl = quintary(Zahl); 

   cin.get();
   cin.get();
}
</code></pre>
<p>Das Programm tut das was es soll, NUR, gibt es das ergebnis dann in der falschen Reihenfolge aus. Wie kann ich dem Programm sagen, dass es die erste Ziffer die es bei quintary ausrechnet als letztes schreiben soll, und die zweite als vorletztes, usw. ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1606233</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1606233</guid><dc:creator><![CDATA[kojo]]></dc:creator><pubDate>Tue, 28 Oct 2008 18:19:26 GMT</pubDate></item><item><title><![CDATA[Reply to Neuling braucht dringend Hilfe on Tue, 28 Oct 2008 18:49:41 GMT]]></title><description><![CDATA[<p>Du könntest es in einem std::vector zwischenspeichern und dann über einen reverse_iterator rauskopieren</p>
<pre><code class="language-cpp">std::vector&lt;int&gt; result;

    while ( gaus != 0 ) {

        zahl2 = gaus / 5;  
        rest = gaus % 5;
        result.push_back(rest);

        gaus = zahl2;
    }

    std::copy(result.rbegin(), result.rend(), ostream_iterator&lt;int&gt;(cout));
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1606252</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1606252</guid><dc:creator><![CDATA[witte]]></dc:creator><pubDate>Tue, 28 Oct 2008 18:49:41 GMT</pubDate></item></channel></rss>