Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - The legal constants in C language are A. 'program' B. -e8 C. 03x D. 0xfL Why?
The legal constants in C language are A. 'program' B. -e8 C. 03x D. 0xfL Why?

Choose D.

Item A single quotes can only expand a single character, not a string.

The presence of e in item B indicates that it is hexadecimal. Since it is hexadecimal, it must start with 0x.

Item C starts with 0, indicating that it is octal, but the x at the end is illegal.

Item D starts with 0x, indicating that it is hexadecimal, so f represents 15, which is legal. The L at the end means long, indicating that the constant is a long integer.