I recently had an interview in C ++ where I was asked how the compiler distinguishes static data members with the same name in two different classes?
Since all static data variables are stored in the data segment, there must be a way in which the compiler keeps track of which static data belongs to the class, especially when they have the same name.
Edit: I answered the name manufactory, but he refused to say that name manipulation is used only among members of the same class.
source
share