我这个程序怎么会报错呢?
#include <stdio.h>
#include<stdlib.h>
#include<time.h>
main()
{
int t,i;
time(&t);
srand(t);
for(i=1;i<=5;i++)
{
printf("%d\n",rand());
}
}
回复 嘿嘿大人:error C2664: 'time' : cannot convert parameter 1 from 'int *' to 'long *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
warning C4508: 'main' : function should return a value; 'void' return type assumed
执行 cl.exe 时出错.