[Coco] question C++

T. Franklin tim at franklinlabs.com
Thu Mar 22 06:28:06 EDT 2012


...and now to throw a monkey wrench in the mix...

Everyone is actually talking about code in "C" not "C++". The CoCo doesn't now or probably will never support "C++". Although "C++" is a super-set of "C", it's pretty much an entirely different language.

And now for the monkey wench...

void function::function( passed& data )
{
 ...
}

The "&" in this "C++" example isn't a pointer. It's a "Reference" which is an entirely different beast (monkey). It acts like a pointer but is actually passing a reference to an object.

A structure pointer in would be used like this:

void function( struct name* data )
{
 data->item = value;
}

A reference would be used like this:

void function::function( name& data )
{
 data.item = value;
}

Confused yet? LMAO!!!

-Pilot


-----Original Message-----
From: John Kent [mailto:jekent at optusnet.com.au]
Sent: Wednesday, March 21, 2012 11:13 PM
To: 'CoCoList for Color Computer Enthusiasts'
Subject: Re: [Coco] question C++

Yes, It can get rather complicated keeping track of pointers and so on.On 22/03/2012 2:32 PM, Luis Fernández wrote:> Thanks, I hope to understand this format, which is extremely complex>> ---------------------------------------------------------------------------------> Making> CoCoDskUtilPack V 1.0.10.zip> http://cococoding.com/cocodskutil/ Thank Aaron Wolfe> My personal blog: http://www.luis45ccs.blogspot.com> --------------------------------------------------------------------------------->-- http://www.johnkent.com.auhttp://members.optusnet.com.au/jekent--Coco mailing listCoco at maltedmedia.comhttp://five.pairlist.net/mailman/listinfo/coco



More information about the Coco mailing list