Possible Duplicate:
What are the differences between struct and class in C++
do structures support OOP as classes??
Possible Duplicate:
What are the differences between struct and class in C++
do structures support OOP as classes??
in C++, there is almost no difference between struct and class. yes OOP is available with the keyword struct.
you can consider both class and struct the same except that:
There is no difference between struct
and class
in C++ except that struct
members are public by default and class
members are private by default. What ever else holds for class
holds for struct
as well in C++.
in C++ and .NET you can have methods defined for a struct as well, in C++ a struct has all members public by default while a class has members private by default. A struct can implement an interface but cannot derive a base class.
structs are value types while classes are reference types.
In my opinion and point of view since a struct cannot derive another class, it does not fully support OOP, that's why we have classes. :)