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

C++ Tutorial (52) - Absolute n00b spoonfeed

Loading...

Sign in or sign up now!
9,218
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Jun 15, 2008

Video tutorials about programming in the C++ programming language.

Part 52:
* const/non-const pointers to const/non-const variables


Pardon my imperfect english.

Forum: http://cpptutorials.freeforums.org/

If you have any suggestions about how to make this video clearer, more n00b helpful, and explanatory, please send me a message.

If you have any C++ questions, please comment.

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (antiRTFM)

  • The way you explain c++ is amazing, i'v watched tutorials by someone els and after about video 10 he shot off and stopped explaining every detail.

    You on the other hand realy know how to get the point across to the listener.

    and i especialy like a reply you wrote where you said "pointers grab variables by the balls" if thats not easy to grasp, i dont know what is.

    thanks a lot antiRTFM.

  • :) yw

  • so in essence you can convert a regular int to a constant int by assigning it to a constant pointer?

  • i wouldnt call it "converting", more like "masking" because it all depends on how you'll access the variable; if you access it directly then you can change it. if you access it by its const 'mask' (meaning- the pointer to const) its not changeable.

  • umm, is there possible to change the value of pointer (but not *pointer)?

    Im sorry, i mention it because you hadn't mentioned it in the past video(i think..)

    How about changing the value of pointer(not *pointer) while it is constant?

  • i'm not sure i understood your question, are you asking about changing the numbers of the address the pointer contains?? that shouldn't ever be a smart thing to do...

    maybe video 53 - 54 - 55 will clear things up a bit more about pointers

Top Comments

  • Thank you so much for your videos. I have watched all of them. I don't know how you do it, but thank you so much!

  • 5 stars.

see all

All Comments (15)

Sign In or Sign Up now to post a comment!
  • @Kobno Ok that doesn't seem to work

  • So could you by using a const pointer pointing to a variable, use the pointer to create an array with a variable amount of elements?

  • @pufixas ptr is referencing the

    int * ptr // the actual pointer

    while

    *prt is accessing the variable stored in the pointer therefore allowing you to change the actual variable.

  • hey... I still dont understand whats defirence between :

    ptr

    and

    *ptr

  • have a question i thought we couldnt put no. in pointers arent they just suppose to hold the memory address of the variables???

  • i see no comments on this video =( but i guess i'll be the first one to comment then ^^ =) since i didnt even had a compiler, or even knew what i was before i started to watching those videos, and now i can make my own small text based programs, it's time to thank you for all your hard work with this =) you're dope, i've learnt alot =D

    THX FOR ALL! YOU'RE MY HERO!

  • Thanks again antiRTFM. Do you have any work / games that we can see..?

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