main.cpp: In function ‘int main()’: main.cpp:46:5: error: ‘int A::y’ is inaccessible within this context 46 | b.y = 3; | ^ main.cpp:9:9: note: declared here 9 | int y; |