ok now i can fairly welly use pointers to a minimum but i cant for the life of me figure out what its usefull for i mean like what can it possibly do to advance my application
Printable View
ok now i can fairly welly use pointers to a minimum but i cant for the life of me figure out what its usefull for i mean like what can it possibly do to advance my application
Well this has been discussed many of times. I am going to say they are not generally usefull in your everyday C++ programming because of std:: containers and references. But there are times that you do have to get down and dirty with some pointer action. It is that fun naughty kind of action too unless you are NULL(0 for you nitpickers) then it just goes downhill. Anyways they are one of those things where it doesn't seem usefull until you need them :D.
pointers are traditionally used to avoid copying large objects and to manage arrays.
their use in this context has been pretty much superseded by references, but there are still cases where pointers are required, for example if you want to pass a NULL value or use dynamic memoryCode:class Huge
{
int MassiveArray[10000];
};
void func(Huge h) // have to copy 40000 bytes here! not cool
{
}
void func(Huge *pH) // only have to copy 4 bytes. much better
{
}