Home >>Cpp Programs >C++ Create Empty Class
In this example we will see a C++ program in which we will create an empty class.
An empty class is a class without data members and member functions.
Program:
#include <iostream>
using namespace std;
// class definition
class Person {};
// main function
int main() {
//object creation
Person per;
// here - we are printing size of the object
cout << "size of per: " << sizeof(per) << endl;
return 0;
}