0
Class vs Struct difference ?
Is there any significant change in space/time difference between both the methods ?
5 Réponses
+ 16
Exactly what @Helioform said.
https://www.sololearn.com/discuss/134212/?ref=app
+ 10
Only difference is that structs have public members by default.
+ 8
@Kinshuk .I think you're confusing C# with C++. Why do we use reference (&) then to pass objects?
+ 4
@Helioform
I read that here few weeks ago : www.differencebetween.info/difference-between-class-and-structure-in-cplusplus
I thought that was what they meant by 'type'
... Maybe they meant something else...
+ 3
Another difference is that data in classes is passed by reference , while it is passed by value in structures by default...