>I'm new here and I need help... haha... I'm taking a C++ course in
>highschool and I need an example of an ADT (Abstract Data Types).
>I'm kinda lost about the whole thing.... haha...
>
>just an example of one would do for me... :D
An ADT is something that you never actually create directly, but base
other things on. For example:
class animal{
//... stuff that all animals have in common
};
Now you'd never actually create an 'animal' - you'd create a type of
animal, but to do this you need a concrete data type:
class dog:public animal{
//... stuff specific to dogs
};
class cat:public animal{
//... stuff specific to cats
}
So here we have an Abstract Data Type called 'animal' and two Concrete
Data Types called 'cat' and 'dog'
If you want another example, try
class vehicle{
//... ADT
};
class car:public vehicle{
//... 'CDT'
};
class neuclear_sub:public vehicle{
//... CDT
};
--
PJH
"...one of the main causes of the fall of the Roman Empire was that,
lacking zero, they had no way to indicate successful termination of
their C programs." - Robert Firth
Alderley plc, Arnolds Field Estate, The Downs, Wickwar, Gloucestershire, GL12 8JD, UK
Tel: +44(0)1454 294556 Fax: +44 (0)1454 299272
Website : www.alderley.com Sales : [EMAIL PROTECTED] Service : [EMAIL PROTECTED]
This email and its contents are confidential and are solely for the use of the intended recipient. If you are not the original recipient you have received it in error and any use, dissemination, forwarding, printing or copying of this email is strictly prohibited. Should you receive this email in error please immediately notify [EMAIL PROTECTED]
This email has been scanned for viruses, however you should always scan emails with your own systems prior to opening.
To unsubscribe, send a blank message to <mailto:[EMAIL PROTECTED]>.
| Yahoo! Groups Sponsor | |
|
|
Yahoo! Groups Links
- To visit your group on the web, go to:
http://groups.yahoo.com/group/c-prog/
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
