Using structure instead of classes

#include<iostream>
using namespace std;
struct sample
{
private:
int i;
public:
sample()
{
}
sample(int k)
{
i=k;
}
void show()
{
cout<<i<<endl;
}
};
int main()
{
struct sample c(2);
cout<<endl;
cout<<sizeof(c)<<endl;
return 0;
}

Advertisements