Like Tree1Likes
  • 1 Post By grumpy

Pointers

This is a discussion on Pointers within the C++ Programming forums, part of the General Programming Boards category; Hello, i started to learn C++ 1 week ago, i am at Pointer lesson ( here ) , and i ...

  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,208
    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.
    Abercromb likes this.
    Right 98% of the time, and don't care about the other 3%.

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

  4. #4
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,638
    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

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