首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C语言 >

一道C程序解决方法

2012-03-05 
一道C程序题目是这样说的:#include的应用练习   1.程序分析:2.程序源代码:test.h文件如下:#defineLAG#def

一道C程序
题目是这样说的:
#include   的应用练习   
1.程序分析:
2.程序源代码:
test.h   文件如下:
#define   LAG   >
#define   SMA   <
#define   EQ   ==
#include   "test.h "   /*一个新文件50.c,包含test.h*/
#include   "stdio.h "
void   main()
{   int   i=10;
int   j=20;
if(i   LAG   j)
printf( "\40:   %d   larger   than   %d   \n ",i,j);
else   if(i   EQ   j)
printf( "\40:   %d   equal   to   %d   \n ",i,j);
else   if(i   SMA   j)
printf( "\40:%d   smaller   than   %d   \n ",i,j);
else
printf( "\40:   No   such   value.\n ");
}
#include   "test.h "   ------------> 这个到底是什么来着啊????!??!?!?

[解决办法]
没啥意义。

估计原题的目的是想说#include指示符可以在文件任何地方出现
[解决办法]
test.h可能是和你的这个程序有关系,想连接在一起,一般在A程序要用到B程序中的定义的时候,可能就要用#include“”来包含头文件。

热点排行