TIP: Click on subject to list as thread! ANSI
echo: nthelp
to: Geo
from: Peter Sawatzki
date: 2004-11-07 12:38:44
subject: Re: C++

From: Peter Sawatzki 

In article , georger{at}nls.net says...

> Here's a perfect example:
>
> int a;
> Date a;
>
> Ok now according to the teacher, because int a is a build in function (int)
> it's a "variable" but Date a is an object because (Date) is
not a built in
> function but is instead a programmer defined "class". Hello?
Isn't (int)
> also a class but it's just provided as part of the base language package (ie
> it's defined by a different programmer)?

int is an ordinal type and you have functions in a library that operate on
it. Date is a class and you have functions that belong to/are part of the
class and that operate on the class (and because of this they are called
"methods"). In some programming languages there are no ordinal
types and everything is "OO" (Smalltalk?). And some languages
have ordinal types and similar named classes and it is possible to convert
between objects and ordinal types (called boxing/unboxing in C# AFAIK).

The main difference is that functions that operate on a class are
implicitly called with the self/this pointer as an invisible
"argument".

Peter

--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)
SEEN-BY: 633/267 270 5030/786
@PATH: 379/45 1 396/45 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.