|
||||||
| C and C++ C and C++ forum for discussing all forms of C except for C#. These languages are powerful low level languages used for creating Operating Systems, Device Drivers, compilers and much more. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
I have no idea what pointers do, can somebody explain to me what they do and stuff like that? I've heard of pointers before but have never used them, and I've heard they're very useful.
|
| Sponsored Links |
|
|
|
|||||
|
Pointers are variables that store memory addresses of variables. You can change which variable's memory address it stores, and also use the * operator to access the contents of the memory address it is storing. Pointers are usually used as the arguments of arrays in functions.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
|
|||||
|
They don't teach it to newcomers because pointers are somewhat useless until you start building data structures, which is higher level programming than intro's. and when you know how to use them, it shouldn't be an issue. If it was an issue, you'd most likely have compile errors along the way telling you about the memory leak.
linked lists, stacks, queues, binary tree, trees...all use pointers. don't know anything about C# though. you have to keep in mind C++ and C are very low level languages. C# and Java are further away from the machine language, so sometimes the "pleasure" of handling memory is taken care of for you in higher level languages. Last edited by icepack; 07-26-2006 at 09:39 PM. |
|
|||||
|
Quote:
There are some basic good habits that can reduce the danger pointers represent, however. Also, they give you TREMENDOUS power.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
| Sponsored Links |
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Issue writing to file: pointer to a class which contains pointers to other classes | Sheemer | C and C++ | 0 | 08-21-2007 02:17 AM |
| Reg Fucntion pointers | sowmi | C and C++ | 9 | 07-29-2007 04:29 AM |
| C basics. | justin1993 | C and C++ | 4 | 07-24-2007 08:56 AM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |