Technical Discussion :: C++
Home > Technical Interview Q&A > C++ > Discussion
13 / 187
Can we implement all the concepts of OOPS using the keyword struct?
Answer:
Yes, struct is similar to class, only all attributes/methods are public by default in the struct. You can very well have methods and attributes in a struct. You can also inherit from a struct (default inheritance is public).
Asked In ::
Varun Kumar Rai
13 Oct, 2019 1:07 PM
Yes, struct is similar to class, only all attributes/methods are public by default in the struct. You can very well have methods and attributes in a struct. You can also inherit from a struct (default inheritance is public).