EECS 280 Lecture Notes - Lecture 9: Type Qualifier, Compile Time

73 views6 pages

Document Summary

*ptr = 2; //it doesn"t like this because we can change the value of y which is supposed to be constant. *a = 5; // not legal, because a acts like it is a pointer to a constant int. = 5; // not legal, because b is constant. Not legal!!! because it allows us to modify x, which is not legal can"t convert a pointer to const to a regular pointers. //go cray with const when using double pointers. //compound object called person struct person { int age; //these are subobjects of the object person string name; bool isninja; declaration: int main() { int x; Person person; //object is person, and variable is also person. //common to have a name of varaible same as the type, uppercase letter is type, lowercase letter is name. When defining a struct we usually use a capital letter (secret!

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