I don't understand the difference between using a pointer and using a normal variable. I'm learning linked lists in class so the use of pointers seems more straightforward since pointers are used to go to the next node in the list, but I don't understand its more basic uses and I'm feeling stressed as it is something I should already understand but don't.
Asked
Active
Viewed 1,651 times
0
-
7We don't normally use pointers unless we have to. – chris Sep 09 '13 at 16:46
-
2take a look at this, it might help clear your head a bit: http://stackoverflow.com/questions/162941/why-use-pointers – Natan Streppel Sep 09 '13 at 16:48
-
yes but I don't understand what a pointer does that a variable doesn't do – gr33kbo1 Sep 09 '13 at 16:48
-
`closed as not constructive`. I'll never understand this. – Math Sep 09 '13 at 16:49
-
3The question makes no sense. Pointers are ordinary variables, meaning that they can easily be *local* variables. The question contraposes "pointers" and "local variables" as something mutually exclusive. – AnT stands with Russia Sep 09 '13 at 16:51
-
1If you don't understand the difference between a pointer and an `int` variable, for example, then you don't understand pointers yet. I suggest you take some further readings to make it clear. – Natan Streppel Sep 09 '13 at 16:53
-
1We use pointers when we need to point to something. That's what they do. – Mike Seymour Sep 09 '13 at 17:02
-
Ask your teacher for help, sooner rather than later. – GManNickG Sep 09 '13 at 17:10
-
@GManNickG: I think a book will be a better option. I mean person that teaches language, doesn't necessarily use that language. – SigTerm Sep 09 '13 at 18:11
1 Answers
0
The pointer is in itself just a "normal" variable that just so happens to store a level of indirection to another variable.

Paul Evans
- 27,315
- 3
- 37
- 54