Add getopt code #6

Merged
cromer merged 2 commits from getopt into master 2018-11-11 13:34:33 -03:00
1 changed files with 9 additions and 0 deletions
Showing only changes of commit bacea22e1d - Show all commits

View File

@ -16,8 +16,17 @@
#include <stdlib.h>
#include <time.h>
/**
* Flag para inicilizar srand solo una vez
*/
static int sort_rand_initialized = 0;
/**
* Generar un númer al azar entre un mínimo y máximo
* @param min El limite míninmo
* @param max El limite máximo
* @return Retorna el número generado
*/
int gen_rand(int min, int max) {
if (sort_rand_initialized == 0) {
srand((unsigned int) time(NULL));