我想根據使用的操作系統定義一個常量。
這樣:在#ifdef中定義常量C
#include <stdio.h>
#ifdef _Win32 //Used for system("cls") command
#include <process.h>
#define CLEAR "system(\"cls\")"
#endif
#ifdef __APPLE__
#define CLEAR "system(\"clear\")"
#endif
int main()
{
CLEAR;
}
的Xcode給我一個錯誤,指出表達結果未使用在
#define CLEAR "system(\"clear\")
和主函數內。
我在Mac上。
耶可愛;叉一個過程,以清除屏幕.... – trojanfoe 2013-02-08 16:39:58