CS136 Midterm: CS 136 - Term Test 1

337 views31 pages
17 Sep 2018
Course
Professor

Document Summary

Overflow: int limit ( -2,147,483,648 ~ 2,147,483,647, int_min & int_max, sizeof (int) = 4 -> limited space is the main reason lead to overflow. Type: char (%c: sizeof (char) = 1, 2. 8 = 256 possible values for a char: character use single quotes. Ascii value 97 (c translates a" into 97) Printf ( %c\n , letter_a) > a / printf ( %d\n , letter_a) > 97. Ascii: to represent text (char) in memory with a numeric code to each character. Screenshot by author. used as integer expression: char can be values in. Symbol type: define a unique integer for each symbol (usually all caps) Type: float %f : c float type can represent real values. 23: expect precision errors, type float always will have some decimal. Float continue: type: double has more precision than float. Type: structures: struct posn { int x; int y: don"t forget the last (;) in the structure definition, struct posn p = {3, 4};

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

Related Documents