A variable is a logical construct that goes to the intent of an algorithm, whereas a memory location is a physical construct that describes the operation of a computer. Generally speaking, in order to execute a program there is (compiler generated) mapping between the logical notion of a variable and the storage of the computer.
(Even in assembly language we have a notion of (logical) variables going to algorithm and intent, and (physical) memory locations, though they are more conflated in assembly.)
A variable is a high(er) level concept. A variable represents either an unknown (as in mathematics, or programming assignment) or a place-holder that can be substituted with a value (as in programming: parameters).
A memory location is a low(er) level concept. A memory location can be used to store a value, sometimes, to store the value of a variable. However, a CPU register is another way to store the value of some variable(s). CPU registers are also low(er) level storage locations, but they are not memory locations as they do not have addresses, just names.
In some sense, a variable is a mechanism of abstraction for expressing intent of the program, whereas a memory location is a physical entity of the processing environment that provides storage & retrieval.
Question 003: Is it true that a pointer is stored inside the memory location 0x23452? Why?
We cannot say fore sure. Just because there is a value there that would work as an address, doesn't mean it is that address, it could be the integer (decimal) 144466, instead. We cannot make assumptions on the interpretation of values merely based on how they appear numerically.
Question 004: Is it true that a pointer is stored inside the memory location 0x23452? Why?
This is indeed an odd question. They expect some assumptions based on the boxes, however, let's note that the addresses increase by 1 for each box. In any modern computer, that would mean that each box can hold a byte — byte addressability has been the norm for decades now. However a byte is only 8-bits and can range from 0 to 255 (for unsigned values); yet they show a much larger value stored within one of these addresses, so very suspicious. (This could work if this were a word addressed machine, but it doesn't say that, and, few machines today are, though some educational machines are so.)
Based on the four flashcards I've shown you all, I'd define pointers in a slightly different way:
A pointer is a memory location whose value is the memory address of another memory location.
While there are situations where this thinking is correct, you are mixing metaphors here. The notion of a variable goes to the algorithm and its intent — there is no need to assume all variables have memory locations. Some variables (especially arrays) have memory locations because memory locations support addressing (whereas CPU registers can only be named not indexed).
For execution, there is a logical mapping between variables & statements and processor memory locations & processor instruction sequences. A variable whose value never changes (e.g. a constant) does not even necessarily require a memory location, since the value can be reproduced at will (e.g. as needed for code sequences generated by the compiler).
a
,0x23453
.nil
etc. stuff inside them are the values. That might seem obvious to you, but I wouldn't be comfortable giving decisive answers to those questions without seeing how those fields are defined. There's really no way of knowing ifa
in the second image is a character, a string (if they're any different), or the name of a variable. If it is a string, then isnil
also a string? Or a "null" value?