-3

I am using the following macro definition in my C program, however, after compilation, it is giving me error that macro names should be identifier. Can anybody tell me what mistake I am doing while defining macro?

#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 
3
  • 4
    Macro identifiers (names) can't begin with digits. Commented Nov 25, 2017 at 18:45
  • 1R0...not an identifier Commented Nov 25, 2017 at 18:45
  • 2
    Even the Stackoverflow C syntax colorizer knows that macro identifiers can't start with a digit... Just look at what you provided: proper identifiers are black or blue when capitalized, those starting with digits are red. Commented Nov 25, 2017 at 18:50

1 Answer 1

0
#define 2R0 3 

Identifiers must start with either a letter or underscore, digits are not allowed.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.