interger constants:
integer constants take one of the following forms:
integer constants take one of the following forms:
- a decimal number e.g 1,123,100002.
- an octal number e.g.,01,01273,0303242.anoctal constant is introduced by a leading 0 and the digits are 0 through 7
- a hexadecimal number e.g.,0X1,0X7b,0X186A2.a hex constant is introduced by a leading 0Xor 0x and the digits are 0 trough 9 followed by a through F
- a character constant
floating point constants take one of the following forms:
- a decimal number followed by a decimal point followed by another decimal number e.g.,1.0,1.9993,3.42
- a number like the previous but with an exponent part i.e an e or E followed by a decimal number e.g 1.0e10,1.23e-2,1.00e+2
- A character constant is a character enclosed in single quotes e.g, 'a','2'
- in a character constant a backslash character is treated specially it introduces an escape sequence
- these escape sequences are usually used to represent characters that are not easy to see when represented by themselves or need to be escaped for syntax reason
No comments:
Post a Comment