Thread: Unsure of this Quiz Question on Pointers Created by Alex

  1. #1
    Registered User
    Join Date
    Dec 2016
    Posts
    45

    Unsure of this Quiz Question on Pointers Created by Alex

    This is the only question I got wrong on Alex's quiz for beginners. I'm unsure why it's correct. I drew out what I think the sentences represent.

    I don't get why the unnamed variable pointed to by pointer a has the address a

    Isn't the variable pointing to an unnamed address? No address has been formally assigned

    Unsure of this Quiz Question on Pointers Created by Alex-quzi-jpg


    I may be mixing up my terminology here. I know that pointers are said to be just be addresses.

    Alex's give some more precise definitions:

    -When I want to talk about a memory address, I'll refer to it as a memory address
    -When I want a variable that stores a memory address, I'll call it a pointer
    -When a variable stores the address of another variable, I'll say that it is "pointing to" that variable
    Last edited by potomac; 12-29-2016 at 11:37 AM.

  2. #2
    Old Took
    Join Date
    Nov 2016
    Location
    Londonistan
    Posts
    121
    Remember a pointer IS an address, well a value interpreted as an address. So the pointer a holds the address of var.

    You can discount D. We have no idea what the function address does. C is the address of the pointer. B is var, the object being pointed at. A is the right answer. A holds the address of var. I think you read the question wrongly. See these one letter variable names are confusing. Let's reword the question....

    Which of the following gives the memory address of a variable pointed to by the pointer ptr?
    A. ptr;
    B *ptr;
    C &ptr;
    D address(ptr);

    See now?

  3. #3
    Registered User
    Join Date
    Dec 2016
    Posts
    45
    That makes sense. Have to keep repeating to myself that a pointer is an address.

    After reading my 2 book chapters twice, reading Alex's tutorial, and watching some videos, I'm at this phase described by Alex, but seem to be learning to handle the operators better:

    "Pointersmay feel like a very confusing topic at first but I think anyone can come toappreciate and understand them. If you didn't feel like you absorbed everythingabout them, just take a few deep breaths and re-read the lesson. You shouldn'tfeel like you've fully grasped every nuance of when and why you need to usepointers, though you should have some idea of some of their basic uses. "

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Many thanks to Alex
    By VirtualAce in forum General Discussions
    Replies: 12
    Last Post: 08-09-2014, 12:47 PM
  2. question in quiz yourself
    By layla in forum C++ Programming
    Replies: 1
    Last Post: 11-26-2010, 03:11 PM
  3. unsure about auto/smart pointers
    By l2u in forum C++ Programming
    Replies: 16
    Last Post: 07-13-2007, 12:55 PM
  4. Website tutorials (Pointers quiz)
    By TheUnknownFacto in forum C++ Programming
    Replies: 6
    Last Post: 04-18-2007, 10:58 AM
  5. Quiz question
    By volk in forum C++ Programming
    Replies: 4
    Last Post: 03-18-2003, 04:51 PM

Tags for this Thread