| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 569 人关注过本帖
标题:这个小程序错在哪里?
只看楼主 加入收藏
georgezf
Rank: 1
等 级:新手上路
帖 子:275
专家分:0
注 册:2004-11-20
收藏
 问题点数:0 回复次数:7 
这个小程序错在哪里?
#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;
}
  
2005-05-28 15:45
zhangzujin
Rank: 1
等 级:新手上路
帖 子:276
专家分:0
注 册:2005-5-9
收藏
得分:0 
#include<dos.h>
#include<stdio.h>
int main(void)
{
 struct dosdate_t d;
 _dos_getdate(&d);
 printf("The current year is:%d\n",d.year);
 printf("The current month is:%d\n",d.month);
 printf("The current day is:%d\n",d.day);
 return 0;
}
应该用dos中的结构体.

太极之道 qq:283421560 E-mail:zhangzujin360732@
2005-05-28 17:58
georgezf
Rank: 1
等 级:新手上路
帖 子:275
专家分:0
注 册:2004-11-20
收藏
得分:0 
哦 ,谢谢

2005-05-28 18:02
georgezf
Rank: 1
等 级:新手上路
帖 子:275
专家分:0
注 册:2004-11-20
收藏
得分:0 
不对,二楼改的还是不对.
   struct date d; 出了问题

2005-05-28 18:03
musicml
Rank: 1
等 级:新手上路
帖 子:273
专家分:0
注 册:2005-4-2
收藏
得分:0 
有什么错误
可以运行!

Every thing is possible.
2005-05-28 18:03
musicml
Rank: 1
等 级:新手上路
帖 子:273
专家分:0
注 册:2005-4-2
收藏
得分:0 
你到底用的什么编译器
在tc2.0下行的呀

Every thing is possible.
2005-05-28 18:05
georgezf
Rank: 1
等 级:新手上路
帖 子:275
专家分:0
注 册:2004-11-20
收藏
得分:0 
我用的C-FREE……

2005-05-28 19:17
georgezf
Rank: 1
等 级:新手上路
帖 子:275
专家分:0
注 册:2004-11-20
收藏
得分:0 
现在我改用TC2.0了,问题解决,其实以前那个程序就没有错误,谢谢各位了

2005-05-28 19:34
快速回复:这个小程序错在哪里?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.011383 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved