CS 24000 Lecture Notes - Lecture 4: Centered Hexagonal Number

13 views2 pages

Document Summary

Integer constants: 1 2 3 4 decimal, 031 octal constant 3*8+1 = 25 starts with 0, 0x4a3 hexadecimal constant 4*16^2+10*16+3= or in binary 0100 1010. 0011: the type of integer constant will be: int if v does not exceed the int range. long if v exceeds an int but not a long, unsigned long if v exceeds long. Integer constants: you can add suffix to force type, 123456789l long, 55u unsigned int, 234lu unsigned long. Floating-point constants: 3. 14 type is always double, to force the type float, add f suffix, 3. 14f float constant. "q" enclosed with a single quote: also you can use escape sequences with "\octal number" e. g. "\020", ascii: 2*8+0=16. "\hex number with two digits" e. g. "\ae": ascii: 10*16+14. Character constants: also there are some common escape sequences "\n" new line. Character constants: character constants have type int, int i, i = "a"; //assign ascii 65 to i.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents