- C++ structs are like C++ class except the default access for struct is public v/s class is private
- C struct can have integral data type only unlike C++ struct that can also have member functions
- C struct cannot have access scope like public, private, protected, but C++ struct can.
- struct A{ int i, int j } ; typedef A A1; typedef needed for C struct and not required for C++ , A can be directly accessed.
What is the difference between C and C++ struct?
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment