Anonymous user
Pointers and references: Difference between revisions
→{{header|C}} and {{header|C++}}: Use "int *pointer" to indicate that the * is part of the initializer, not the type declaration (that is, "int* a, b" won't work as expected).
(+Icon+Unicon) |
(→{{header|C}} and {{header|C++}}: Use "int *pointer" to indicate that the * is part of the initializer, not the type declaration (that is, "int* a, b" won't work as expected).) |
||
Line 100:
The following code creates a pointer to an int variable
int var = 3;
int
Access the integer variable through the pointer:
int v = *pointer; /* sets v to the value of var (i.e. 3) */
|