Why are you calling srand
in a loop? Just call it once at the start of your program and then call rand
any number of times.
More Related Contents:
- srand() — why call it only once?
- srand function is returning same values
- How does srand relate to rand function?
- How to use function srand() with time.h? [duplicate]
- Random numbers in C
- Unit testing for a function (tolower) using pointers
- How to allocate an array with NULL [closed]
- Returning an array using C
- Can’t compile C program on a Mac after upgrade to Mojave
- Is there a performance difference between i++ and ++i in C?
- Are there any non-twos-complement implementations of C?
- Type conversion – unsigned to signed int/char
- While (( c = getc(file)) != EOF) loop won’t stop executing
- How undefined is undefined behavior?
- iOS library to BitCode
- Undefined reference to pow( ) in C, despite including math.h [duplicate]
- How to obtain the correct physical size of the monitor?
- How can I include a needed C library using GCC?
- why is -1>strlen(t) true in C? [duplicate]
- Which C99 features are available in the MS Visual Studio compiler?
- Implementing a FIFO mutex in pthreads
- A program uses different regions of memory for static objects, automatic objects, and dynamically allocated objects
- Should variable definition be in header files?
- What does request_mem_region() actually do and when it is needed?
- What do pty and tty mean?
- How to implement a linked list in C?
- gcc detect duplicate symbols/functions in static libraries
- Serving multiple domains in one box with SNI
- Why won’t extern link to a static variable?
- How much overhead can the -fPIC flag add?