Jump to content

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* *pointer = &var;
Access the integer variable through the pointer:
int v = *pointer; /* sets v to the value of var (i.e. 3) */
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.