Mail Archives: djgpp/1997/11/21/05:30:21
> What is object orientated programming and in what way does it differ
> from normal C.
>
Object Oriented Programming is a good thing... after first learning OOP
in C++ and then having to go back to C for some Corps of Engineers work,
I am very much in favor of OOP.
At first glance OOP looks merely like creating structures that have
member functions in addition to the normal data members. However, it is
really a lot more. One thing that's great is inheritance [sp?]... you
can create one class that encapsulates one form of object. Then you
come in and create other classes that inherit the traits of that base
class and add more specific functions and data to describe a more
precise version of that object. For instance you can create a door
object for a D&D style game, later you can come in and create new
objects that inherit the original door characteristics (Isitopen,
Isitstuck, etc.) such as a lockable door which has a new flag in it's
member data (Isitlocked).
Another good thing is polymorphism... this basicly involves controlling
which function will be called if an inherited class has an identicle
function name, but does something different than the class it is
inherited from.
Hope that helps,
-Greg
- Raw text -