エラー指令
提供: cppreference.com
< c | preprocessor
指定されたエラーメッセージを表示し、プログラムを ill-formed にします。
目次 |
[編集]構文
#error error_message | |||||||||
[編集]説明
#error
指令に遭遇した後、処理系は診断メッセージ error_message を表示し、プログラムを ill-formed にします (コンパイルを停止します)。
error_message は複数の単語から構成することができます。 引用符で囲む必要はありません。
[編集]例
Run this code
#if __STDC__ != 1# error "Not a standard compliant compiler"#endif #include <stdio.h>int main (void){printf("The compiler used conforms to the ISO C Standard !!");}
出力例:
The compiler used conforms to the ISO C Standard !!