On 12/17/05, Jason Benjamin <red...@ya...> wrote:
> What is the use of pointers, linked lists,
> polymorphism,and operator overloading?
Well, these things are all indespensible. You don't have to use them
at every possible chance, but they can make life much easier.
First, the thing I do know a bit about, is pointers. Coming from
Java, this is a really cool thing. In Java, unless you're using a
global variable, you have to return a object/variable if you want to
keep any changes made to it during a function's execution. There
isn't a easy way to keep the changes made to multiple variables,
except by using arrays. Mixed object/variable types? Things can get
very complex very quickly. Enter pointers. By using a pointer you
can directly use a variable. This can be dangerous, but it can also
be very powerful.
I don't know anything about linked lists yet, so I can't speak for that.
Polymorphism is very powerful. Look at virtual functions and you'll
quickly find it's realy strength. Operator overloading is
indespensible. Consider the "=3D" operator. it's actually overloaded
to work with multiple data types.
All these things have purposes. While you and I might not understand
all of them, they are there for a reason.
|