R
Robben
Hi,
Part of the question could be OT, so please bare with me for that.
As I was told/know/read the main difference between struct and class is
that for a struct all member variables and methods are public.
I managed to write a small program as shown below, and managed to
successfully compile using c++ compiler but did not manage to do the
same with c compiler....
struct A
{
public:
A(){ printf(" A:: constructor \n"); }
~A(){ printf(" A:: destructor \n"); }
void print(){ printf(" A:rint \n"); }
};
Does that mean what ever I had learned is pertaining only to C++ and
not C.
Thanks
Part of the question could be OT, so please bare with me for that.
As I was told/know/read the main difference between struct and class is
that for a struct all member variables and methods are public.
I managed to write a small program as shown below, and managed to
successfully compile using c++ compiler but did not manage to do the
same with c compiler....
struct A
{
public:
A(){ printf(" A:: constructor \n"); }
~A(){ printf(" A:: destructor \n"); }
void print(){ printf(" A:rint \n"); }
};
Does that mean what ever I had learned is pertaining only to C++ and
not C.
Thanks