SRL Archive - C/C++ Help and Tutorials

c++(pointers) help


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!

ShowerThoughts

2009-03-12 11:52:20

Not MINE but : http://home.impsoft.info/downloads/C%2B%2B%20basics%20tutorial.pdf from Cplusplus.com

hackncrack1

2009-03-12 11:53:23

ill check it out thanks

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 :)

hackncrack1

2009-05-24 21:00:55

hermen the link is dead

ShowerThoughts

2009-05-25 01:03:44

http://home.impsoft.info/downloads/C%2B%2B%20basics%20tutorial.pdf

Fix'd

hackncrack1

2009-05-25 09:38:26

thanks