2017-11-25 2 views
-3

私のCプログラムでは次のマクロ定義を使用していますが、コンパイル後にマクロ名を識別子にする必要があります。マクロを定義する際に私が何をしているのか、誰に教えてもらえますか?プリプロセッサディレクティブを定義すると、コンパイル時に未知の識別子が返される

#include <stdio.h> 
#include <stdlib.h> 

#define a0 0 
#define x1 1 
#define a1 2 
#define x0 3 
#define x0a1 4 
#define b0 5 
#define b1 6 
#define y0 7 
#define y1 8 
#define y0b1 9 
#define c0 10 
#define z1 11 
#define c1 12 
#define b1 13 
#define z0 14 

#define 1R0 0 
#define 1B0 1 
#define 1W0 2 

#define 2R0 3 
#define 2B0 4 
#define 2W0 5 

#define 3R0 6 
#define 3B0 7 
#define 3W0 8 

#define Running 0 
#define Blocked 1 
#define Waiting 2 
+4

マクロ識別子(名前)は数字で始めることはできません。 –

+0

'1R0' ...識別子ではありません – coderredoc

+2

Stackoverflow Cのシンタックスカラーライザーでさえ、マクロ識別子が数字で始めることができないことを知っています...あなたが提供したものを見てください:大文字で始まる数字は赤です。 – Jens

答えて

0
#define 2R0 3 

識別子は、数字が許可されていない文字またはアンダースコアのいずれかで開始する必要があります。

関連する問題