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

esskar
 2005-08-27 15:53
#11260 #11260
User since
2003-08-04
7321 Artikel
ModeratorIn

user image
was hast du denn für einen C compiler

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 );
ts = timebuffer.time * 1000 + timebuffer.millitm;

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


so funzt es wenigstens richtig

View full thread zufällige Zufallszahlen