COMPTNG 10A Chapter Notes - Chapter 4: Dereference Operator, Stephan Endlicher

47 views3 pages
14 Sep 2017
School
Professor

Document Summary

Double* ptr = ptr is type double pointer; ptr is a pointer of type double bytes. Addresses written in bytes int and floats = 4 chars and bools = 1 string = 24. * = indirection or dereference operator: access variables of the address pointer is pointing to. Defining a pointer sizeof operator returns the number of bytes to store a variable: sizeof(int) = 4, sizeof(double) = 8 array. White space next to the * in declaration has not affect const double d1 and double const d1 = same thing: double* ptr or double *ptr or double * ptr = same. Do(cid:374)(cid:859)t use a de(cid:272)laratio(cid:374) list for poi(cid:374)ters: double *ptr1, *ptr2; // bad style, double* ptr3; // good, double* ptr4; // good type conversion/casting = changing the type of a variable to another. Double x = 3; // literal 3 from int to double.

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