我是C新手,我维护着一些代码。我在头文件中遇到了这个问题。我可以理解,如果在Windows上编译源代码,它将输入if语句,否则,如果代码在Linux上编译,它将进入else语句。纠正我,如果我错了。#ifdef #else #endif宏问题
但是,问题是为什么在所有包含头之前使用#(散列)?
非常感谢您的任何建议,
#ifdef WIN32
# include <conio.h>
# include <process.h>
# include <stdlib.h>
# include <string.h>
#else
# include <unistd.h>
# include <termio.h>
# include <sys/types.h>
# include <sys/stat.h>
# include <fcntl.h>
#endif
是的,就是这样。我被#和包含之间的空间弄糊涂了。谢谢。 – ant2009 2009-07-21 03:21:13