class A {
int x;
static int i;
};
int x = 10;
int A::i = x;
When I compile the code above, it get the error
<source>:8:12: error: invalid use of non-static data member 'A::x'
8 | int A::i = x;
| ^
<source>:2:9: note: declared here
2 | int x;
| ^
What's causing this error?