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
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 .
Woop?
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 { }
"I saw a sign that said 'Drink Canada Dry', so I started"
-- Brendan Behan
Free Compiler: Visual C++ 2005 Express
If you program in C++, you need Boost. You should also know how to use the Standard Library (STL). Want to make games? After reading this, I don't like WxWidgets anymore. Want to add some scripting to your App?