December 2013
Beginner
576 pages
16h 4m
English
When you define an object variable such as a Fraction, as in
Fraction *myFract;
you’re really defining a pointer variable called myFract. This variable is defined to point to something of type Fraction, which is the name of your class. When you allocate a new instance of a Fraction, with
myFract = [Fraction alloc];
you’re allocating space to store a new Fraction object in memory (that is, space for a structure) and then storing the pointer to that structure that is returned inside the pointer variable myFract.
When you assign one object variable to another, as in
myFract2 = myFract1;
you’re simply copying pointers. Both variables end up pointing to the same structure stored somewhere in memory. Making ...
Read now
Unlock full access