初学者有关问题:error C2065: 'random' : undeclared identifier怎么解决

菜鸟问题:error C2065: 'random' : undeclared identifier如何解决?
error   C2065:   'random '   :   undeclared   identifier如何解决?

------解决方案--------------------
error C2065: 'random ' : undeclared identifier如何解决?
random是什么类型的?
如果是类,定义类的头文件+了没或者声明了没?
------解决方案--------------------
int rand( void );

这个函数没参数

Example

/* RAND.C: This program seeds the random-number generator
* with the time, then displays 10 random integers.
*/

#include <stdlib.h>
#include <stdio.h>
#include <time.h>

void main( void )
{
int i;

/* Seed the random-number generator with current time so that
* the numbers will be different every time we run.
*/
srand( (unsigned)time( NULL ) );

/* Display 10 numbers. */
for( i = 0; i < 10;i++ )
printf( " %6d\n ", rand() );
}


Output

6929
8026
21987
30734
20587
6699
22034
25051
7988
10104