Pointers

I have recently read about pointers but I have not yet discovered why I should use pointers instead of just normal ints or chars and so on.
Why should I even use pointers at all?
Because
1) you might need to keep track of the address of something.
2) some library calls expect pointers.
3) you might want to allocate something on the heap. new returns a pointer.
Consider for example designes of linked lists or processing of character arrays. For example consider standard C function strchr

Its declaration (in C) is

char * strchr(const char *s, int c);

Last edited on
See my post in this thread:

http://cplusplus.com/forum/general/105593/

for some reasons to use pointers.
Okay, that makes sense. Thank you all!
Topic archived. No new replies allowed.