急!!!VC中说random()和getdate()未定义
我用C写的程序在C++中调试,发现random()和getdate()居然报未定义的错误,晕啊,我在网上查的,大家都一样嘛,请问在VC中是不是要做什么配置啊?急!
#include <dos.h>
#include <stdio.h>
int main(void)
{
struct date d;
getdate(&d);
printf("The current year is: %d\n",
d.da_year);
printf("The current day is: %d\n",
d.da_day);
printf("The current month is: %d\n",
d.da_mon);
return 0;
}
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
/* prints a random number in the range 0 to 99 */
int main(void)
{
randomize();
printf("Random number in the 0-99 range: %d\n", random (100));
return 0;
}
上面是网上的例子,都报错,恳请各位一定要救我啊!