Thread: Pointers

  1. #1
    Registered User
    Join Date
    Aug 2011
    Posts
    2

    Smile Pointers

    Hello, i started to learn C++ 1 week ago, i am at Pointer lesson (here) , and i don't understand , what pointers do , when to use, can somebody explain me in clear and short words. I also want some exercise based on pointers, to understand much better. Thanks.

  2. #2
    Registered User
    Join Date
    Jun 2005
    Posts
    6,815
    A pointer is a type of variable that contains the address in memory of some other variable. For example, a pointer to an int (if appropriately initialised) contains the address in memory of an int.

    I'l lleave it to someone else to recommend exercises.
    Right 98% of the time, and don't care about the other 3%.

    If I seem grumpy or unhelpful in reply to you, or tell you you need to demonstrate more effort before you can expect help, it is likely you deserve it. Suck it up, Buttercup, and read this, this, and this before posting again.

  3. #3
    Registered User
    Join Date
    Aug 2011
    Posts
    2
    Thanks grumpy for reply) ,it helped me to understand a little.

  4. #4
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    For an "exercise", make use of a linked list in your next program. Linked lists are like arrays, but you can extend them without replacing the entire data structure, which is one of their strengths over arrays.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. size of struct with pointers and function pointers
    By sdsjohnny in forum C Programming
    Replies: 3
    Last Post: 07-02-2010, 05:19 AM
  2. Storing function pointers in generic pointers
    By Boxknife in forum C Programming
    Replies: 6
    Last Post: 08-01-2009, 01:33 PM
  3. Pointers to objects -- passing and returning pointers
    By 1veedo in forum C++ Programming
    Replies: 4
    Last Post: 04-04-2008, 11:42 AM
  4. weak pointers and use_count smart pointers
    By Mario F. in forum C++ Programming
    Replies: 2
    Last Post: 07-29-2006, 07:54 AM
  5. Assigning pointers from pointers in struct.
    By Brian in forum C Programming
    Replies: 2
    Last Post: 10-18-2003, 04:30 AM