| | |
Pointers
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2005
Posts: 1,678
Reputation:
Solved Threads: 263
0
#2 Oct 23rd, 2009
Pointers are useful for a variety of reasons. For, example, let's say I want to pass the value of my salary from one function to another. The value of my salary will be changed in the function it is passed to and I want to use that new value in a third function. Pointers are one way that allow the change in a variables value in one function to be retained in the calling function. Or let's say I have a collection of appointments that are used in several different places and I want to be able to arrange it so that if I change something in one appointment that change is reflected wherever that appointment might be used. Pointers allow that to happen. Or let's say that I want to use more variables than the compiler stack will allow. I might be able to go into preferences and change the size of the compiler stack, but by using pointers I can access memory outside the compiler stack using dynamic memory. Or let's say I have a group of objects all derived from the same base class and I want to be able to call a single function and get the action of the specific derived class by using the same function call. Pointers allow that to happen to. There are probably other examples as well, and some of my examples may not be the most clear. Suffice it to say that learning how pointers work is an integral part of writing code in some languages, so take a deep breath, count to 10, and jump in.
Klatu Barada Nikto
![]() |
Similar Threads
- Pointers (archived tutorial) (C++)
- Problem About Pointers (C++)
- New to C++ Pointers and need help with identifying where the errors are (C++)
- Linked List using pointers (C++ ADT) (C++)
- Why can't I use Pointers to point to a Enumurated Constant (C++)
Other Threads in the C++ Forum
- Previous Thread: help plz
- Next Thread: c++ used for games
| Thread Tools | Search this Thread |
api array beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion count data database delete desktop developer directshow dll download dynamic email encryption error file forms fstream function functions game getline google graph gui homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text text-file tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






