Question 4: Which of the following statements correctly describe the code below in C++?

#define language 437            //Line 1

#if language < 400

#undef language                 //Line 2

#else                           //Line 3

#define language 850            //Line 4

#ifdef language                 //Line 5

   printf("%d", language);      //Line 6

#endif

#endif

A. An error or warning will occur on Line 6 because a macro cannot be used as

part of a preprocessor directive.

B. An error or warning will occur on Line 2 because #undef is not a valid preprocessor directive.

C. An error or warning will occur on Line 4 because language has already been defined.

D. If Line 1 is changed to #define language 300, Line 6 will print "850".

E. An error or warning will occur on Line 3 because #else can only be used as the last conditional in the chain.

 

A C

你可能感兴趣的:(C++,c,preprocessor)