Thread zufällige Zufallszahlen (5 answers)
Opened by J-jayz-Z at 2005-08-27 02:12

esskar
 2005-08-27 15:20
#11258 #11258
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
stimmt, ich depp

versuch es mal so:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/timeb.h>

int main(int argc, const char *argv[]) {
     int i;
     unsigned int ts;
     struct _timeb timebuffer;
     
     _ftime( &timebuffer );
     memcpy(&ts, &timebuffer, sizeof(unsigned int));

     srand( ts );
     for(i=0; i <= 10; i++)
             printf("%d\n", rand());
     return 0;
}
\n\n

<!--EDIT|esskar|1125141632-->

View full thread zufällige Zufallszahlen