Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Basic Pointers

Loading...

Sign in or sign up now!
8,514
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Oct 9, 2007

The basics of pointers. I did NOT make this video. I am simply uploading it to YouTube so I can link it directly as part of my tutorial. Proper credits are in the credits.

Pointers are mainly used with functions. Since variables within a function are terminated when that function returns, you use a pointer to directly manipulate the address of that variable so that any changes made to the variable in that function are carried over when the function returns.

Example:
int myFunction(int *pMyPointer);

When that function is called, you pass the address of your argument(s) instead, like so:

myFunction(&myVariable);

Any changes to that variable will carry over, but you must dereference the pointer in order to make a change to the value stored there, like so:

*pMyVariable = value;

Category:

Howto & Style

Tags:

License:

Standard YouTube License

  • likes, 3 dislikes

Link to this comment:

Share to:

Uploader Comments (Spunky48)

  • very funny, but pointers are also initialized with values like all variables, so it's not pointing to nothing...

  • Initialization is optional, you can choose not to initialize a pointer but it's dangerous. Uninitialized pointers are called "wild pointers".

see all

All Comments (20)

Sign In or Sign Up now to post a comment!
  • im so dumb that you going to have to use fingers and swearing...i hate pointers ... fu*%en 'asterisk '

  • Great man....I understand them now!

    Thanks.

  • Treat me like a CHILD and we will NEVER get real. ahha

  • This is destined to be a classic...

  • ahahhaha

  • SSpoke: Great examples. thank you

  • When dynamically allocating memory, don't forget to delete kids! :P

  • Good call. Done. :)

  • thanks for explaining it,

    nicely explained :)

  • u might want to put this in ur description

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more