like this!
we have classes in c++
but why most of data structres and algorithm books written in c++ always using struct to implement their structers?
or i have a data structers book that written some of structres with class and some of them with struct .
why????
struct and class are mostly identical in C++ save for one point: classes have a default accessibility of private while structs have a default of public
i know the difference between the class and struct, but my question is what is the advantages of struct? cause most of example is with struct
Struct means it's a bag of data. Class means it's OOP.
bag of data must be the C definition
Обсуждают сегодня