(*Mack)->name = name;
because *Mack is a pointer to a Truck.
It''s the same as
(**Mack).name = name;
Pointer casting and indirection is killing me!
last newbie/silly question of the night/day....
so this is legal also?
(*Mack)->name = name;
or should it be (*Mack).name = name; ???<br><br>so sorry for silly questions? this just confuses me so much. </i>
so this is legal also?
(*Mack)->name = name;
or should it be (*Mack).name = name; ???<br><br>so sorry for silly questions? this just confuses me so much. </i>
(*Mack).name = name;<br><br>In what context?<br>if Mack is an array of pointers to Truck it's correct. But then it will be more readable:<br>Mack->name = name;<br><br>The operators -> and [] are mere abbreviations (if aren't overloaded):<br> x->y is for (*x).y<br> <br> and x is for *(x + i)<br><br><br><br><br>edited because was fucking as italics<br><br><SPAN CLASS=editedby>[edited by - Pepe on December 10, 2002 7:33:12 AM]</SPAN>
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement