Share
What is the difference between struct and class in C++?
Question
can you help me with this question
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
can you help me with this question
Answer ( 1 )
struct
: Members are public by default.class
: Members are private by default.Example:
struct A { int x; }; // x is public
class B { int y; }; // y is private by default