随机数产生random

随机数产生推荐用random(),在产生随机数前要添加种子srandom((unsigned int)time(NULL))。

SYNOPSIS
#include <stdlib.h>

long int random(void);

void srandom(unsigned int seed);

旧版本为rand()和srand().

原文地址:https://www.cnblogs.com/embedded-linux/p/6083760.html