Topic : C-Language Documentation Author : John Kormylo Version : C.HYP 1.0 Subject : Documentation/C-Language Nodes : 233 Index Size : 6362 HCP-Version : 3 Compiled on : Atari @charset : atarist @lang : en @default : @help : Help @options : +g -i -s +x +z -t4 @width : 75 View Ref-File[ Constants ] Character constants: Type is char Syntax: '<single character>' or '\<backslash sequence>' Examples: 'a' '0' '\0' '\\' See also Backslash Sequences. String constants: Type is char* Syntax: "<list of characters and backslash sequences>" Examples: "string" "first line\nsecond line\n" Strings can be extended over two lines of source: puts("this is a" " very long string"); A NULL ('\0') character is automatically appended. See also Backslash Sequences and the -M flag of Compiler Options. Decimal constants: Default type is int Syntax: [+/-] <digits> [L | l] where <digits> are composed of 0 1 2 3 4 5 6 7 8 9 and L or l indicates long. Examples: 255 -1 999999L Octal constants: Default type is int Syntax: [+/-] 0 <octal digits> [L | l] where <octal digits> are composed of 0 1 2 3 4 5 6 7 and L or l indicates long. Examples: 0377 -01 0777777L Hexadecimal constants: Default type is int Syntax: [+/-] 0x <hex digits> [L | l] where <hex digits> are composed of 0 1 2 3 4 5 6 7 8 9 a b c d e f (or A B C D E F) and L or l indicates long. Examples: 0xff -0x1 0x123456L Floating point constants: Type is float or double Syntax: [+/-] <digits> [. <digits>] [e |E [+/-] <digits> ] (float) or [+/-] <digits> [. <digits>] c | C [+/-] <digits> (double) Examples: 0.0 1.0 1e3 == 1000.0 3.141592653589793c0 Either the '.' or 'e' is required for a float. The 'c' is always required for a double. Note: Compiler pre-computes all calculations involving only constants and converts to appropriate type. Multiplication by a constant is implemented using shift and add instructions (so using x<<2 instead of x*4 saves you nothing). (See -G flag of Compiler Options.)