[Tutor] Variable Modification in a class

Alan Gauld alan.gauld@blueyonder.co.uk
Tue Jun 3 18:37:01 2003


Danny Yoo wrote:
> AB* b = malloc(sizeof(AB));
> AB* c = malloc(sizeof(AB));

Boy my C is rusty, I even got malloc wrong after 
I "fixed" it. I forgot the sizeof() mantra... And 
I didn't need the cast coz they are type compatible. 
Doh! That's what living with Java, C++ and Python 
does for you. Glad you are around Danny, to show 
the right way to do it! :-)

Alan G.