<?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[Probleme mit Randomize() und random(n)]]></title><description><![CDATA[<p>ahoi,<br />
habe ne frage.<br />
Also wenn ich in einem Formular z.B.</p>
<pre><code>void __fastcall TForm1::Button1Click(TObject *Sender)
{
a = random(6)+1;
b = random(6)+1;

c=a+b;
Label1-&gt;Caption=c;
}

void __fastcall TForm1::FormCreate(TObject *Sender)
{
Randomize();
}
</code></pre>
<p>schreibe, gibt er mir jedes mal die selbe zahlenkette aus (3,8,7,4,...), warum?<br />
Ich starte doch bei FormCreate den Zufallszähler oder nicht.</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/75851/probleme-mit-randomize-und-random-n</link><generator>RSS for Node</generator><lastBuildDate>Sun, 28 Jun 2026 17:21:31 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/75851.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 05 Jun 2004 13:01:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Probleme mit Randomize() und random(n) on Sat, 05 Jun 2004 13:01:55 GMT]]></title><description><![CDATA[<p>ahoi,<br />
habe ne frage.<br />
Also wenn ich in einem Formular z.B.</p>
<pre><code>void __fastcall TForm1::Button1Click(TObject *Sender)
{
a = random(6)+1;
b = random(6)+1;

c=a+b;
Label1-&gt;Caption=c;
}

void __fastcall TForm1::FormCreate(TObject *Sender)
{
Randomize();
}
</code></pre>
<p>schreibe, gibt er mir jedes mal die selbe zahlenkette aus (3,8,7,4,...), warum?<br />
Ich starte doch bei FormCreate den Zufallszähler oder nicht.</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/533570</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/533570</guid><dc:creator><![CDATA[ttester]]></dc:creator><pubDate>Sat, 05 Jun 2004 13:01:55 GMT</pubDate></item><item><title><![CDATA[Reply to Probleme mit Randomize() und random(n) on Sat, 05 Jun 2004 17:26:15 GMT]]></title><description><![CDATA[<p>ttester,</p>
<p>ttester schrieb:</p>
<blockquote>
<p>Randomize();</p>
</blockquote>
<p>das ist ein bekannter bug, glaube ich. Es wird statt dessen die Verwendung von &quot;randomize&quot; (kleines r) empfohlen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/533823</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/533823</guid><dc:creator><![CDATA[dschensky]]></dc:creator><pubDate>Sat, 05 Jun 2004 17:26:15 GMT</pubDate></item></channel></rss>