woaini92887 发表于 2014-11-24 13:34:23

帮我看看这段代码那里错了 是C函数库中的列子呀

#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;
}

小人 发表于 2014-11-24 13:54:18

printf("The current month is: %d\n", d.da_mon);
应该不能换行的输出吧

风之残月 发表于 2014-11-24 14:47:05

如果你使用的是VC++6.0的话,这个程序不能通过,原因它里面的dos.h中不包含getdate函数、date结构,但在TroboC 中运行可以通过

woaini92887 发表于 2014-11-25 10:27:21

风之残月 发表于 2014-11-24 14:47
如果你使用的是VC++6.0的话,这个程序不能通过,原因它里面的dos.h中不包含getdate函数、date结构,但在Trob ...

那怎么办呢 我想在VC 中用这个函数
我发现VC 有些图像函数也不能用
那个Xcode能不

风之残月 发表于 2014-11-25 19:53:43

Xcode不清楚,你去网上找找看吧
页: [1]
查看完整版本: 帮我看看这段代码那里错了 是C函数库中的列子呀