Benutzer-Werkzeuge

Webseiten-Werkzeuge


edv:prg:c:example:zufaellige_int-zahl

Zufällige int-Zahl

int intMax;
int intRandom;
 
srand((unsigned int) time(0L)); // Sequenz initialisieren
intRandom = rand() % intMax;    // Ergebnis: 0 < intRandom < intMax

:!: Wichtiger Hinweis:

When compiling multithreaded applications,  the   _REENTRANT
flag  must be defined on the compile line.  This flag should
only be used in multithreaded applications.

EOF

edv/prg/c/example/zufaellige_int-zahl.txt · Zuletzt geändert: 2020/01/11 01:23 von 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki