can class inherit struct in C++? -


this question has answer here:

i have following code in c++:

typedef struct {    int a;    int b;    float c; } data;  class datainfo : public data {    // code here }; 

my question can class inherit struct in c++? how happens?

struct included in c++ provide complitability c. has same functionality class, members in struct public default. can inherit class struct , same in reverse.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -