<?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[Speocherzugrifffheler]]></title><description><![CDATA[<p>hi, wolte ig nur kurz n progg für die berechnung von fakultäten on zahlen schreibn, aber es kommt immer diese ausgaen (77 ist vion mir iegegeebn und is egal, tritt auch bei anderen zahlen auf, die nr des fehlers ist jedesmal anderst,a ber immer in dem bereich):</p>
<p>code:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;cstdlib&gt;

using namespace std;

typedef unsigned int uint;

uint fak(uint zahl);

int main()
{
  uint zahl;
  cout &lt;&lt; &quot;Bitte eine Zahl eingeben, von der die Fakultät berechnet werden soll!&quot; &lt;&lt; endl;
  cin &gt;&gt; zahl;
  cout &lt;&lt; &quot;Die Fakultaet ist: &quot;&lt;&lt; fak(zahl) &lt;&lt; endl;

  return EXIT_SUCCESS;
}

uint fak(uint zahl)
{
  if(zahl == 0)
    return 1;
  return zahl*fak(zahl - 1);
}
</code></pre>
<p>ausgabe:</p>
<pre><code>Bitte eine Zahl eingeben, von der die Fakultät berechnet werden soll!
77
/bin/sh: line 1:  6254 Speicherzugriffsfehler  ./helloworld
Betätigen Sie die Eingabetaste, um fortzufahren!
</code></pre>
<p>log:</p>
<pre><code>cd '/home/lukas/src/helloworld/debug' &amp;&amp; WANT_AUTOCONF_2_5=&quot;1&quot; WANT_AUTOMAKE_1_6=&quot;1&quot; gmake -k 
gmake all-recursive
gmake[1]: Entering directory `/home/lukas/src/helloworld/debug'
Making all in src
gmake[2]: Entering directory `/home/lukas/src/helloworld/debug/src'
gmake[2]: Für das Ziel »all« ist nichts zu tun.
gmake[2]: Leaving directory `/home/lukas/src/helloworld/debug/src'
gmake[2]: Entering directory `/home/lukas/src/helloworld/debug'
gmake[2]: Für das Ziel »all-am« ist nichts zu tun.
gmake[2]: Leaving directory `/home/lukas/src/helloworld/debug'
gmake[1]: Leaving directory `/home/lukas/src/helloworld/debug'
*** Erfolg ***
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/175134/speocherzugrifffheler</link><generator>RSS for Node</generator><lastBuildDate>Fri, 18 Sep 2026 23:40:01 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/175134.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 07 Mar 2007 13:56:09 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Speocherzugrifffheler on Wed, 07 Mar 2007 17:57:28 GMT]]></title><description><![CDATA[<p>hi, wolte ig nur kurz n progg für die berechnung von fakultäten on zahlen schreibn, aber es kommt immer diese ausgaen (77 ist vion mir iegegeebn und is egal, tritt auch bei anderen zahlen auf, die nr des fehlers ist jedesmal anderst,a ber immer in dem bereich):</p>
<p>code:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;cstdlib&gt;

using namespace std;

typedef unsigned int uint;

uint fak(uint zahl);

int main()
{
  uint zahl;
  cout &lt;&lt; &quot;Bitte eine Zahl eingeben, von der die Fakultät berechnet werden soll!&quot; &lt;&lt; endl;
  cin &gt;&gt; zahl;
  cout &lt;&lt; &quot;Die Fakultaet ist: &quot;&lt;&lt; fak(zahl) &lt;&lt; endl;

  return EXIT_SUCCESS;
}

uint fak(uint zahl)
{
  if(zahl == 0)
    return 1;
  return zahl*fak(zahl - 1);
}
</code></pre>
<p>ausgabe:</p>
<pre><code>Bitte eine Zahl eingeben, von der die Fakultät berechnet werden soll!
77
/bin/sh: line 1:  6254 Speicherzugriffsfehler  ./helloworld
Betätigen Sie die Eingabetaste, um fortzufahren!
</code></pre>
<p>log:</p>
<pre><code>cd '/home/lukas/src/helloworld/debug' &amp;&amp; WANT_AUTOCONF_2_5=&quot;1&quot; WANT_AUTOMAKE_1_6=&quot;1&quot; gmake -k 
gmake all-recursive
gmake[1]: Entering directory `/home/lukas/src/helloworld/debug'
Making all in src
gmake[2]: Entering directory `/home/lukas/src/helloworld/debug/src'
gmake[2]: Für das Ziel »all« ist nichts zu tun.
gmake[2]: Leaving directory `/home/lukas/src/helloworld/debug/src'
gmake[2]: Entering directory `/home/lukas/src/helloworld/debug'
gmake[2]: Für das Ziel »all-am« ist nichts zu tun.
gmake[2]: Leaving directory `/home/lukas/src/helloworld/debug'
gmake[1]: Leaving directory `/home/lukas/src/helloworld/debug'
*** Erfolg ***
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1240957</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1240957</guid><dc:creator><![CDATA[43R0N]]></dc:creator><pubDate>Wed, 07 Mar 2007 17:57:28 GMT</pubDate></item><item><title><![CDATA[Reply to Speocherzugrifffheler on Wed, 07 Mar 2007 13:59:50 GMT]]></title><description><![CDATA[<p>Die Bedingung in der if-Abfrage wird <strong>niemals</strong> wahr, dadurch landest du in einer Endlos-Rekursion, die dir früher oder später den Stack zumüllt. Technisch benötigst du dort eine ODER-Verknüpfung (||).</p>
<p>(und praktisch hat die Funktion überhaupt nichts mit Fakultäten zu tun)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1240959</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1240959</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 07 Mar 2007 13:59:50 GMT</pubDate></item></channel></rss>