No! You’re talking some mix-up of C and C++. This is C code. C does not have references.
The &
operator can be applied to objects in order to retrieve their address in memory, yielding a pointer, in both C and C++. It ain’t got nothing to do with references. Even in C++.
In C++, you can use the ampersand character (&
) to define a reference:
int i;
int& b = i; // reference referencing i
This is not possible in C, though.
BTW, printf
uses specific format specifiers for specific types. %d
is for int
s. For pointers (like &i
), use %p
. Wrong usage of the wrong format specifier is undefined behavior.
solved Pointer variable of a linked list: difference between the variable, reference to the variable, and pointer to the variable [closed]