PreviousNext
Help > Software > The “C.impl” Interpreter > Data Constants
Data Constants

'character'

A single 8-bit ASCII character

 

Some non-printable characters (those with ASCII code smaller than 32) have predefined constants:

 

'\0'   - ASCII code 0 (character NUL)

'\a'   - ASCII code 7 (alarm)

'\b'   - ASCII code 8 (backspace)

'\e'   - ASCII code 27 (escape)

'\f'   - ASCII code 12 (form feed)

'\n'   - ASCII code 10 (new line)

'\r'   - ASCII code 13 (carriage return)

'\t'   - ASCII code 9 (horizontal tabulation)

'\\'   - the character 'backslash'

'\''   - the character 'single quote'

'\"'   - the character 'double quote'

'\?'   - the character 'question mark'

 

In addition to the predefined constants, any ASCII code could be also entered in its digital form:

\xnn’ with ‘nn’ as a two-digit hexadecimal code in the range 00…FF,

or as

\nnn’ with ‘nnn’ as a three-digit decimal code in the range 0...255.

 

"string"

A zero-terminated string of 8-bit characters

 

String constants can be split on to multiple source lines as long as there is nothing else other than whitespace characters between them

 

up to 64-bit decimal integer numbers; optionally preceded by ‘0d or ‘0D

up to 64-bit hexadecimal unsigned numbers; preceded by ‘0x’ or ‘0X

up to 64-bit binary unsigned numbers; preceded by ‘0b’ or ‘0B

up to 64-bit octal unsigned numbers; preceded by ‘0

 

[sign] [ iii [ .fff [E or e [sign] [ eee [.xxx ] ] ] ] ]

 

 

A floating point number

 

Where:

iii.fff are the integer part and the fraction of the number, accordingly.

 

The ‘E’ or ‘e’ symbol indicates that an exponent is being supplied to the number.

 

eee.xxx are the integer part and the fraction of the exponent, accordingly.

 

Numeric constants also support suffix specifiers for sign and/or size

 

Unsigned integer

Trailing ‘U’ or ‘u

Long integer or long double

Trailing ‘L’ or ‘l

Long long integer

Trailing ‘LL’ or ‘ll

Single precision FP number

Trailing ‘F’ or ‘f

Double precision FP number

Trailing ‘D’ or ‘d

 

The default type of all integer constants, unless explicitly specified, is signed int.

The default type of floating point number constants, unless explicitly specified, is float.