+ 4

Can we implement all the concepts of OOPS using the keyword struct in c++

11th May 2017, 4:52 AM
Nikhil
Nikhil - avatar
2 Antworten
+ 3
You can follow object oriented programming styles using structs and functions, but there is no enforcement of the implementation. So, in a shared development situation someone could just alter the value of something in the struct. That said, when programming in a procedural language (as opposed to an object oriented one), keeping your good habits of being careful with your data is a fantastic idea.
11th May 2017, 5:49 AM
Jim
Jim - avatar
+ 2
Yes you can. If I'm not wrong, the only difference between "class" and "struct" is that "class" members and functions are by default private and "struct"'s are public.
11th May 2017, 5:26 AM
Toky R.
Toky R. - avatar