I need a decent explination.....

This is a discussion on I need a decent explination..... within the C++ Programming forums, part of the General Programming Boards category; i used the tutorial furnished by the site, but i am still a bit foggy on the whole pointer thing, ...

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    51

    I need a decent explination.....

    i used the tutorial furnished by the site, but i am still a bit foggy on the whole pointer thing, i mean i get that...


    int x = 5;
    int *ptr;
    ptr = &x;
    *ptr = x;

    i understand that, but what about the importance, and the actually use of this, ( i want to programm a game in c ++ ) i am a tad stuck on these.and what about the pointers passing functions? im a bit confused on that as well





    any help would be greatly appreciated thankyou






    "To the world you may be just one person, but to one person you may be the world"

    - anonyumous

  2. #2
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    that little demo is not how you would really use pointers, it's just a quick demo of the different address related syntax. Pointers are used for lots of reasons including passing large pieces of data into a function. You don't want to make copies of the data so you just use the address of the original. Then you can change the values in the original.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  3. #3
    Veni Vidi Vice
    Join Date
    Aug 2001
    Posts
    343
    In the beginning-stage of learning c++ itīs easy to get confused by pointers. My advise is to learn them (syntax) and when you are comfortable with it learn how to implement them. Pointer(s) are used for different kinds of things, for example witout pointer(s) dynamic memory allocation wouldnīt be possible.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Decent TV recording software - ideas?
    By ulillillia in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 04-04-2009, 08:20 PM
  2. (autotools) make does not decent to src
    By kroiz in forum Linux Programming
    Replies: 3
    Last Post: 01-29-2009, 01:12 PM
  3. Decent recorder?
    By Shadow in forum Tech Board
    Replies: 0
    Last Post: 05-17-2004, 02:08 AM
  4. Explination?
    By tetraflare in forum C++ Programming
    Replies: 2
    Last Post: 10-13-2002, 11:39 AM
  5. Need example and explination...
    By Gamma in forum C++ Programming
    Replies: 1
    Last Post: 04-15-2002, 09:38 PM

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