pointers

This is a discussion on pointers within the C Programming forums, part of the General Programming Boards category; Does anyone know a good place to find examples and an explanation to learn pointers? I have looked through several ...

  1. #1
    Unregistered
    Guest

    pointers

    Does anyone know a good place to find examples and an explanation to learn pointers? I have looked through several posts, books, and online and can't find a good beginner's explanation with examples. All I know about pointers is
    for example:

    int number;
    int *p;
    p = &number;

    I don't know how with characters though because with characters you have to give it storage like char this[15];

    Can anyone offer something that might help, whether it be your example & explanation, a book, or somewhere online..any suggestions? Thank you.

  2. #2
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    Use this sites tutorials. They're usualy pretty good. Bascially, a pointer is just an address. You know that, but here's why. If you need to pass a whole array to a function, it's hard. So you pass the pointer, initialized to the first element. Then to get the next part, you just use pointername++, to increment it to the next spot in memory. It's a broad subject with dereferincing and all, so try and ask specific questions.

  3. #3
    Unregistered
    Guest
    There is a fellow named Marshal Brain that has a site called How Stuff Works. It has a section on C, which includes discussions of pointers. I found it to be good and you can find it at:
    http://www.howstuffworks.com/c.htm

  4. #4
    Im back! shaik786's Avatar
    Join Date
    Jun 2002
    Location
    Bangalore, India
    Posts
    345

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485

  6. #6
    Unregistered
    Guest
    Thanks a lot everybody. It's a lot of help :-)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MergeSort with array of pointers
    By lionheart in forum C Programming
    Replies: 18
    Last Post: 08-01-2008, 10:23 AM
  2. Using pointers to pointers
    By steve1_rm in forum C Programming
    Replies: 18
    Last Post: 05-29-2008, 05:59 AM
  3. Request for comments
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 01-02-2004, 09:33 AM
  4. Staticly Bound Member Function Pointers
    By Polymorphic OOP in forum C++ Programming
    Replies: 29
    Last Post: 11-28-2002, 12:18 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21