首页 > 代码库 > C++ Q&A

C++ Q&A

Why can I access private variables in the copy constructor?

The access modifiers work on class level, and not on object level.That is, two objects of the same class can access each others private members. stackoverflow link