hackncrack1
2009-03-12 11:51:04
hey guys i have started c++ and rad many tuts but i couldn't understand pointers cud some1 please give an detailed explanation of them?
thank you!
Ethien
2009-04-08 15:43:46
I could explain if you'd like.
boberman
2009-04-09 13:24:08
The basics behind pointers is that they are just a locations to memory addresses. They aren't the actual data there. So, for example, If I have a pointer to a int, the pointer may have the value 0x1000, but the int has the value of 0x10. If I where to dereferance the pointer, I would get the value in the int (0x10) If I didn't dereferance the pointer I would get the address of the int (0x1000).
Macrosoft
2009-04-09 20:41:34
yeah, i dont think iv ever found a use for pointers…
Can anyone think of one?
unless if ur reading data from a location that is not in the program…i guess
boberman
2009-04-12 10:44:09
From: Macrosoft
yeah, i dont think iv ever found a use for pointers…
Can anyone think of one?
unless if ur reading data from a location that is not in the program…i guess
Ummm…. Pointers are EXTREMELY useful!
For example, ever done dynamic memory allocation? How about using an array? not to mention the necessity of them in many OO applications, you can't make something like a linked list without a pointer.
Macrosoft
2009-04-14 22:14:02
i never use that :)
im pretty sure allocating memory is the only time i use it lol, ty fr reminding me
i like C# pointer system better, less complicated :)