EECS 280 Lecture Notes - Lecture 9: Type Qualifier, Compile Time
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!