Will the following code compile?

class Clazz
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