0

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.

9
  • 7
    We don't normally use pointers unless we have to. Commented Sep 9, 2013 at 16:46
  • 2
    take a look at this, it might help clear your head a bit: stackoverflow.com/questions/162941/why-use-pointers Commented Sep 9, 2013 at 16:48
  • 3
    The 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. Commented Sep 9, 2013 at 16:51
  • 1
    If 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. Commented Sep 9, 2013 at 16:53
  • 1
    We use pointers when we need to point to something. That's what they do. Commented Sep 9, 2013 at 17:02

1 Answer 1

0

The pointer is in itself just a "normal" variable that just so happens to store a level of indirection to another variable.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.