Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to judge whether the given data is an integer constant in C language, such as -0 12, 0x35, 123L, 8E2?
How to judge whether the given data is an integer constant in C language, such as -0 12, 0x35, 123L, 8E2?
There are three kinds of integer constants: decimal integer constants, such as 123L (the last bit can be L, U, etc. To represent long integers and unsigned).

Octal integer constants, starting from 0, such as 0 123, some data say that octal has no negative number, but -0 12 is also an allowed hexadecimal number, starting from 0x, such as 0x35, -0x 12 is also exponential, belonging to real number constants, not to integer constants.

3.-0 12 is not, because in C/C++, binary, octal and hexadecimal numbers are all unsigned numbers. 8E2 is not a floating point number.

4.c doesn't seem to have such a function. You need to write one yourself, C++? It can be judged by cin.good ().