Will the following code compile?

class Clazz
{
};
Explanation
You can declare empty classes, but objects of such types still have nonzero size. Therefore, the objects have different addresses. Having different addresses makes it possible to compare pointers to objects for identity.
More information: Empty Classes

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Keep exploring
C++ quizzes
Cosmo
Sign Up Now
or Subscribe for future quizzes