English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

10 answers

Because if you don't need to instaniate new objects, it saves memory. And using less memory makes your program more efficient.

2007-02-01 15:13:07 · answer #1 · answered by Anonymous · 0 0

There is no dumb question. Take the scientist that asked, "Why should Pluto be a Planet?" After years of debate, the scientific community said "It's NOT".... and I really loved that dog.

If I have the address to an object or collection, I'll just pass that to a subroutine or function to do it's thing. When I think of a pointer to an object, it seems so small. But if I passed the physical object to a subroutine or function, it just might be the size of Pluto.

Yes, it's all done with pointers anyway... but in C++, the old GEEKS wanted to be sure.

Good luck and Happy Computing!

2007-02-01 22:55:19 · answer #2 · answered by Anonymous · 0 1

There are a couple of advantages of using a pointer rather than creating an object through a class variable:
1> object pointers make polymorphism possible. polymorphism is a useful feature in various cases. eg. designing a GUI class.
2> if there are a lot of objects that you have to create, then you might have memory problem, coz, object variables are created in stack memory (which is lesser than heap memory). for this, you have to create objects through pointers dynamically through malloc, calloc or new. dynamically created objects reside in heap memory.
3> there are a lot more obvious features of pointers like passing object pointer to functions eliminates duplication of objects and saves memory, also enables you to modify objects inside another function. there are also advantages related to pointer to a function. etc. etc.

2007-02-02 00:12:00 · answer #3 · answered by cipher 3 · 0 0

In addition to the other uses mentioned, pointers are very useful when dealing with large data arrays. They let you create multiple indexes, sort in multiple ways, or work with selected subsets of the data in a structured way, among other handy tricks.

2007-02-02 02:58:43 · answer #4 · answered by injanier 7 · 1 0

a pointer is for making selections eiser, there is a series of buttone to press if you dont have a mouse, i know a few but a mouse just makes life easy.... and you didnt finish your second question......yeah

2007-02-01 22:50:57 · answer #5 · answered by Sponge2009 2 · 0 1

Or use a touchscreen?

You could invent the next big techy toy!

2007-02-01 22:51:19 · answer #6 · answered by Anonymous · 0 1

I wish you had finished your question. It may be that your personal "bs" detector is working well.

2007-02-01 22:51:29 · answer #7 · answered by Caper 4 · 0 1

Your right............It's a dumb question

2007-02-01 22:50:35 · answer #8 · answered by Rowdy Yayhoot 7 · 0 1

call an object and.....

2007-02-01 22:50:27 · answer #9 · answered by yiohon 2 · 0 1

because thats why

2007-02-01 22:50:59 · answer #10 · answered by twysty 5 · 0 1

fedest.com, questions and answers