<?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[Zufall]]></title><description><![CDATA[<p>moin<br />
kann mir jemand sagen wie wie ich eine zufallszahl mit &quot;rand&quot; bekomme<br />
hab den teil mit der time funktion nicht verstanden<br />
danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/130398/zufall</link><generator>RSS for Node</generator><lastBuildDate>Thu, 27 Aug 2026 03:02:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/130398.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Dec 2005 16:12:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Zufall on Thu, 22 Dec 2005 16:12:39 GMT]]></title><description><![CDATA[<p>moin<br />
kann mir jemand sagen wie wie ich eine zufallszahl mit &quot;rand&quot; bekomme<br />
hab den teil mit der time funktion nicht verstanden<br />
danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/947948</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/947948</guid><dc:creator><![CDATA[ronsen]]></dc:creator><pubDate>Thu, 22 Dec 2005 16:12:39 GMT</pubDate></item><item><title><![CDATA[Reply to Zufall on Thu, 22 Dec 2005 16:37:47 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Zufalssgenerator initialisieren mit:</p>
<pre><code class="language-cpp">srand((unsigned)(time(NULL));// time.h einbinden
</code></pre>
<p>und dann rand aufrufen:</p>
<pre><code class="language-cpp">int iZufall;
iZufall= rand()%10 //Zufallszahlen zwischen 0 unf 9
</code></pre>
<p>Ich hoffe, dass das verständlich war</p>
<p>chrishce</p>
]]></description><link>https://www.c-plusplus.net/forum/post/947967</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/947967</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Thu, 22 Dec 2005 16:37:47 GMT</pubDate></item><item><title><![CDATA[Reply to Zufall on Fri, 23 Dec 2005 08:29:40 GMT]]></title><description><![CDATA[<p>ronsen schrieb:</p>
<blockquote>
<p>moin<br />
kann mir jemand sagen wie wie ich eine zufallszahl mit &quot;rand&quot; bekomme<br />
hab den teil mit der time funktion nicht verstanden<br />
danke</p>
</blockquote>
<p>rand() liefert bei jedem Aufruf eine neue (Pseudo)Zufallszahl. Und der Teil mit dem time() dient dazu, die Zahlenfolge zu initialisieren (andernfalls beginnt rand() immer mit dem selben Startwert und liefert deshalb bei jedem Programmstart die selbe Zahlenfolge).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/948332</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/948332</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 23 Dec 2005 08:29:40 GMT</pubDate></item><item><title><![CDATA[Reply to Zufall on Mon, 02 Jan 2006 20:55:19 GMT]]></title><description><![CDATA[<p>srand((unsigned)(time(NULL));// time.h einbinden[/cpp]</p>
<p>wofür steht das unsingned?<br />
danke für die bisherigen antworten</p>
]]></description><link>https://www.c-plusplus.net/forum/post/955114</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/955114</guid><dc:creator><![CDATA[ronsen]]></dc:creator><pubDate>Mon, 02 Jan 2006 20:55:19 GMT</pubDate></item><item><title><![CDATA[Reply to Zufall on Mon, 02 Jan 2006 20:57:44 GMT]]></title><description><![CDATA[<p>ronsen schrieb:</p>
<blockquote>
<p>srand((unsigned)(time(NULL));// time.h einbinden[/cpp]</p>
<p>wofür steht das unsingned?<br />
danke für die bisherigen antworten</p>
</blockquote>
<p><a href="http://www.volkard.de/vcppkold/signed_und_unsigned.html" rel="nofollow">http://www.volkard.de/vcppkold/signed_und_unsigned.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/955116</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/955116</guid><dc:creator><![CDATA[golden_jubilee]]></dc:creator><pubDate>Mon, 02 Jan 2006 20:57:44 GMT</pubDate></item><item><title><![CDATA[Reply to Zufall on Tue, 03 Jan 2006 00:19:59 GMT]]></title><description><![CDATA[<p>ronsen schrieb:</p>
<blockquote>
<p>srand((unsigned)(time(NULL));// time.h einbinden[/cpp]<br />
wofür steht das unsingned?</p>
</blockquote>
<p>es war, um sich zu verwirren. die zeile srand((unsigned)(time(NULL)) geistert seit vielen jahren durch die foren. eigentlich ist damit nur folgendes gemeint:</p>
<pre><code class="language-cpp">srand(time(0));
</code></pre>
<p>man sollte nicht ohne not casten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/955263</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/955263</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Tue, 03 Jan 2006 00:19:59 GMT</pubDate></item></channel></rss>