我是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