Is a C++ class without inhertitance, overloaded operators, contructors or destructor and private members same as a C struct?
My criteria for "same" are as follows:
- They are interchangeable in the code
- The machine code the compiler generate are same on a line by line basis
- It makes sense to say they are the same (on a conversation)
If I were to slap a class
and make every member public
, do I still have the same program? Is the generated assembly same?
Essentially, is a C++ POD equivalent to a C struct with the same members?