A pointer is exactly what is sounds like, it points to some other memory.
Lets take this simple example:
BOOL actualVariable = FALSE;
BOOL *pointerVariable = &actualVariable;
That makes pointerVariable
point to actualVariable
. Using the derefernece operator (unary *
) you can get the value of what a pointer points to:
printf("Value of *pointerVariable = %d\n", *pointerVariable);
That should print
Value of *pointerVariable = 0
More graphically you can look at it this way:
+-----------------+ +----------------+
| pointerVariable | ----> | actualVariable |
+-----------------+ +----------------+
You can also use the dereference operator to change the value of where the pointer points:
*pointerVariable = TRUE;
If you declare a pointer, and don't make it point anywhere, then attempting to dereference the pointer (i.e. get what the pointer points to) will result in undefined behavior.
Now regarding your warning. A pointer variable is actually a simple integer, whose value is the address of where it points. That means you can in theory assign any integer value to it, and the program will think that the value is an address of something valid. Most of the time it is not something valid though.
You get the warning because usually using an integer value to initialize a pointer is the wrong thing to do, you should initialize the pointer with another pointer to the same type.