关于C++中的 rand 和 srand 函数
打开文件 stdlib.h (如果安装的是 Code::Blocks, 则位于 C:\Program Files\CodeBlocks\MinGW\include 中)
cstdlib, ctime 等位于 C:\Program Files\CodeBlocks\MinGW\lib\gcc\mingw32\4.7.1\include\c++
/* * RAND_MAX is the maximum value that may be returned by rand. * The minimum is zero. */ #define RAND_MAX 0x7FFF _CRTIMP int __cdecl __MINGW_NOTHROW rand (void); _CRTIMP void __cdecl __MINGW_NOTHROW srand (unsigned int);
References: