I'm learning referencing in C and here is my code:
#include <stdio.h>
int main(void)
{
int x = 5;
int &ref = x;
printf("%d\n", x);
printf("%p\n", &x);
printf("%p\n", &ref);
return 0;
}
When i compile, it shows these errors:
reference.c:7:6: error: expected identifier or '('
int &ref = x;
reference.c:11:18: error: use of undeclared identifier 'ref'
printf("%p\n", &ref);
2 errors generated.
What should i do to fix this and thanks in advance.