Open
Description
I'd like to propose adding reference to C as an clang extension. The same one C++ has.
A reference, like a pointer, stores the address of an object that is located elsewhere in memory. Unlike a pointer, a reference after it's initialized can't be made to refer to a different object or set to null. There are two kinds of references: lvalue references, which refer to a named variable and rvalue references, which refer to a temporary object. The
&
operator signifies an lvalue reference and the&&
operator signifies either an rvalue reference, or a universal reference (either rvalue or lvalue) depending on the context.
https://learn.microsoft.com/en-us/cpp/cpp/references-cpp
int main() {
int i; // Declare the object.
int& ref = i; // Declare and initialize the reference.
ref = 5;
printf("%i\n", i); // "5"
}