I was just preparing small codes showing C++ properties. In the following code I use 'linux' variable name and get this error.
#include <cstdio>
#include <cstdlib>
int main(){
int linux = 19;
int& debian = linux;
debian = 90;
printf("%i\n",linux);
}
which gets:
(base) philo@PL627RC:~/cppTutorials$ g++ references.cpp -o reference
references.cpp: In function ‘int main()’:
references.cpp:5:13: error: expected unqualified-id before numeric constant
5 | int linux = 19;
| ^~~~~
references.cpp:6:23: error: cannot bind non-const lvalue reference of type ‘int&’ to
an rvalue of type ‘int’
6 | int& debian = linux;
This small code works for any other variable name including 'linu' etc. What does this error refers to? Can anybody explain. Thanks.