I noticed that the struct acts exactly like a class, so what's the difference, except the fact that unlike the class, the struct is public by default?
Thank you.
Code:#include <iostream>
using namespace std;
struct point
{
private:
int a, b;
public:
point()
{
cout<<"buidling...\n";
}
~point()
{
cout<<"dead!!!\n";
}
void func(void);
};
void point::func(void) {
cout<<"something here...!!!\n";
}
int main()
{
struct point p1;
p1.func();
return(0);
}