<?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[Rätsel bei bool !]]></title><description><![CDATA[<p>#include &lt;iostream.h&gt;<br />
#include &lt;stdlib.h&gt;</p>
<p>void main(void)<br />
{<br />
bool a=false, b=false, c=false, d=false;<br />
float ergebnis[1];</p>
<p>cout &lt;&lt; &quot;a=&quot; &lt;&lt; a &lt;&lt; endl;<br />
cout &lt;&lt; &quot;b=&quot; &lt;&lt; b &lt;&lt; endl;<br />
cout &lt;&lt; &quot;c=&quot; &lt;&lt; c &lt;&lt; endl;<br />
cout &lt;&lt; &quot;d=&quot; &lt;&lt; d &lt;&lt; endl;<br />
for (int i=0; i&lt;2; i++){ ergebnis[i]=1; }<br />
cout &lt;&lt; &quot;a=&quot; &lt;&lt; a &lt;&lt; endl;<br />
cout &lt;&lt; &quot;b=&quot; &lt;&lt; b &lt;&lt; endl;<br />
cout &lt;&lt; &quot;c=&quot; &lt;&lt; c &lt;&lt; endl;<br />
cout &lt;&lt; &quot;d=&quot; &lt;&lt; d &lt;&lt; endl;</p>
<p>system (&quot;PAUSE&quot;);<br />
}</p>
<p>Ergebnis ist :<br />
0<br />
0<br />
0<br />
0<br />
63<br />
128<br />
0<br />
0</p>
<p>Kann das jemand nachvolziehen ?...ich benutze Borland 4.9.5.0 . Danke !</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/117518/rätsel-bei-bool</link><generator>RSS for Node</generator><lastBuildDate>Fri, 21 Aug 2026 00:46:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/117518.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 08 Aug 2005 14:02:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Rätsel bei bool ! on Mon, 08 Aug 2005 14:02:57 GMT]]></title><description><![CDATA[<p>#include &lt;iostream.h&gt;<br />
#include &lt;stdlib.h&gt;</p>
<p>void main(void)<br />
{<br />
bool a=false, b=false, c=false, d=false;<br />
float ergebnis[1];</p>
<p>cout &lt;&lt; &quot;a=&quot; &lt;&lt; a &lt;&lt; endl;<br />
cout &lt;&lt; &quot;b=&quot; &lt;&lt; b &lt;&lt; endl;<br />
cout &lt;&lt; &quot;c=&quot; &lt;&lt; c &lt;&lt; endl;<br />
cout &lt;&lt; &quot;d=&quot; &lt;&lt; d &lt;&lt; endl;<br />
for (int i=0; i&lt;2; i++){ ergebnis[i]=1; }<br />
cout &lt;&lt; &quot;a=&quot; &lt;&lt; a &lt;&lt; endl;<br />
cout &lt;&lt; &quot;b=&quot; &lt;&lt; b &lt;&lt; endl;<br />
cout &lt;&lt; &quot;c=&quot; &lt;&lt; c &lt;&lt; endl;<br />
cout &lt;&lt; &quot;d=&quot; &lt;&lt; d &lt;&lt; endl;</p>
<p>system (&quot;PAUSE&quot;);<br />
}</p>
<p>Ergebnis ist :<br />
0<br />
0<br />
0<br />
0<br />
63<br />
128<br />
0<br />
0</p>
<p>Kann das jemand nachvolziehen ?...ich benutze Borland 4.9.5.0 . Danke !</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848029</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848029</guid><dc:creator><![CDATA[rumcajs007]]></dc:creator><pubDate>Mon, 08 Aug 2005 14:02:57 GMT</pubDate></item><item><title><![CDATA[Reply to Rätsel bei bool ! on Mon, 08 Aug 2005 14:08:05 GMT]]></title><description><![CDATA[<p>Ja Kann ich.<br />
Du schreibst auf ergebnis[1] damit überschreibst du a und b.<br />
du hast ergebnis mit nur <strong>einem</strong> element definiert.<br />
Kurt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848032</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848032</guid><dc:creator><![CDATA[ZuK]]></dc:creator><pubDate>Mon, 08 Aug 2005 14:08:05 GMT</pubDate></item><item><title><![CDATA[Reply to Rätsel bei bool ! on Mon, 08 Aug 2005 14:08:14 GMT]]></title><description><![CDATA[<p>Buffer Overflow (Ergebnis enthält nur einen Wert, du greifst auf zwei zu)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848033</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848033</guid><dc:creator><![CDATA[masterofx32]]></dc:creator><pubDate>Mon, 08 Aug 2005 14:08:14 GMT</pubDate></item><item><title><![CDATA[Reply to Rätsel bei bool ! on Mon, 08 Aug 2005 14:08:33 GMT]]></title><description><![CDATA[<p>rumcajs007 schrieb:</p>
<blockquote>
<pre><code class="language-cpp">#include &lt;iostream.h&gt;
#include &lt;stdlib.h&gt;
int main(void)
{
  float ergebnis[1];
  for (int i=0; i&lt;2; i++)
    ergebnis[i]=1;
  system (&quot;PAUSE&quot;);

  return 0;
}
</code></pre>
</blockquote>
<p>Na schreibt da nicht jemand über seinen Speicher hinaus?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848034</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848034</guid><dc:creator><![CDATA[hehejo]]></dc:creator><pubDate>Mon, 08 Aug 2005 14:08:33 GMT</pubDate></item><item><title><![CDATA[Reply to Rätsel bei bool ! on Mon, 08 Aug 2005 14:11:14 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">for (int i=0; i&lt;2; i++){ ergebnis[i]=1; }
</code></pre>
<p>ist keine gute Idee, weil du ein floatarray mit nur platz für ein float allokiert hast, hier aber 2 mal reinschreibst.<br />
wenn du 2mal einen wert zuweisen willst, dann bitte</p>
<pre><code class="language-cpp">float ergebnis[2];
</code></pre>
<p>zusatz:<br />
ändere mal die obersten Zeilen wie folgt um</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
using namespace std;
int main()
</code></pre>
<p>//edit hier ist mir heute echt zuviel los gg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848035</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848035</guid><dc:creator><![CDATA[shapeless]]></dc:creator><pubDate>Mon, 08 Aug 2005 14:11:14 GMT</pubDate></item><item><title><![CDATA[Reply to Rätsel bei bool ! on Mon, 08 Aug 2005 14:11:08 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich würde mal sagen deine schleife verursacht das.</p>
<p>Das passiert etwa in deiner schleife:</p>
<pre><code>i=0
   erg[0]=1

   i=1
  erg[1]=1
</code></pre>
<p>abbruch.</p>
<p>Du bist off-by-one. Du hast nur platz für einen float.</p>
<p>//EDIT das nenn ich mal zu langsam</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848037</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848037</guid><dc:creator><![CDATA[prolog]]></dc:creator><pubDate>Mon, 08 Aug 2005 14:11:08 GMT</pubDate></item><item><title><![CDATA[Reply to Rätsel bei bool ! on Mon, 08 Aug 2005 14:12:59 GMT]]></title><description><![CDATA[<p>nein, langsam ist anders; aber 4 antworten in 42 sekunden sind denk ich rekordverdächtig...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848039</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848039</guid><dc:creator><![CDATA[shapeless]]></dc:creator><pubDate>Mon, 08 Aug 2005 14:12:59 GMT</pubDate></item><item><title><![CDATA[Reply to Rätsel bei bool ! on Mon, 08 Aug 2005 14:16:12 GMT]]></title><description><![CDATA[<p>Wahnsinn ! Mit float ergebnis[2]; geht's. Danke !!!! In 2 min. 3 Antworten, net schlecht !!! DANKE!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848040</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848040</guid><dc:creator><![CDATA[rumcasj007]]></dc:creator><pubDate>Mon, 08 Aug 2005 14:16:12 GMT</pubDate></item><item><title><![CDATA[Reply to Rätsel bei bool ! on Mon, 08 Aug 2005 14:18:31 GMT]]></title><description><![CDATA[<p>shapeless schrieb:</p>
<blockquote>
<p>nein, langsam ist anders; aber 4 antworten in 42 sekunden sind denk ich rekordverdächtig...</p>
</blockquote>
<p>Besser noch. Es waren 5 Antworten in 44 sekunden.<br />
K<br />
Edit: Doch nicht eine war 2 min später.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/848041</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848041</guid><dc:creator><![CDATA[ZuK]]></dc:creator><pubDate>Mon, 08 Aug 2005 14:18:31 GMT</pubDate></item><item><title><![CDATA[Reply to Rätsel bei bool ! on Mon, 08 Aug 2005 14:21:02 GMT]]></title><description><![CDATA[<p>...ich meld mich nochmal ! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/848050</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/848050</guid><dc:creator><![CDATA[rumcajs007]]></dc:creator><pubDate>Mon, 08 Aug 2005 14:21:02 GMT</pubDate></item></channel></rss>