COMP 206 Lecture Notes - Lecture 8: Type Conversion, Integer Basic, Actual Size

38 views6 pages

Document Summary

Lecture 8 dynamic memory and process organization. Type conversions in c: c is a (cid:862)statisti(cid:272)all(cid:455) t(cid:455)ped(cid:863) la(cid:374)guage. If operands of an expression are of different types the compiler automatically promotes to the higher precision type according to the following hierarchy: Int: unsigned, long, unsigned long, float, double, long double, e. g. 2/3. 0: 2 will be promoted from an int to a double, instead of 3. 0 being demoted to an int. Pointers and type conversion: the output of this progra(cid:373) depe(cid:374)ds o(cid:374) (cid:862)e(cid:374)dia(cid:374)(cid:374)ess(cid:863) sample code github, endianness_test. c. Word endianess: the order that bytes are stored in memory is only a convention, most systems we deal with will be little-endian. It is always better to check than assume: 1st address, most significant byte (big endian, least significant byte (little endian) In what year was a 119-year-old born: 2018-119, math operatio(cid:374)s are do(cid:374)e (cid:862)(cid:271)a(cid:272)k(cid:449)ards(cid:863) A(cid:374)other (cid:862)got(cid:272)ha(cid:863: when creating pointers, we must think about the stack push-pop behavior:

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