分享方式:


嚴重錯誤 C1018

未預期的 #elif

#elif 指示詞出現在 #if#ifdef#ifndef 建構外部。 請僅在其中一個建構內使用 #elif

下列範例會產生 C1018:

// C1018.cpp
#elif      // C1018
#endif

int main() {}

可能的解決方式:

// C1018b.cpp
#if 1
#elif
#endif

int main() {}