Differences and similarities between class and structures in C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Differences and similarities between class and structures in C++

21st Mar 2017, 7:45 AM
Serjeel Ranjan
Serjeel Ranjan - avatar
2 Answers
+ 2
class is same as struct but two cases: default member visibility is private for class and public for struct. Also default inheritance is private for class and public for struct. In last case the best practice is to explicitly specify these keywords. There are no more any differences between them.
21st Mar 2017, 10:27 PM
soman
0
similarities b/w class and struct in C++ at lest 150
18th Oct 2020, 12:47 PM
Sumayya hameed
Sumayya hameed - avatar