Assuming the class in question is only used hold data fields which are directly accessed, which would be more performant to use, class or a struct with similar fields.
Asked
Active
Viewed 73 times
-2
-
2A `struct` is a `class` with all its members having public access. As such, there would be no performance difference. – 101010 Sep 03 '14 at 16:32
-
You my friend need to master the art of searching in the web before programming, it will increase your results exponentially – Claudiordgz Sep 03 '14 at 16:38
1 Answers
4
No. A class
is the same exact thing as a struct
, the only thing that changes is that, by default, class
members are private
and struct members are public.
There are also more changes related to inheritance and access type, but for more info on that check this question.

Community
- 1
- 1

ArthurChamz
- 2,039
- 14
- 25
-
1Inheritance is also public by default on a struct and private by default on a class, but who's counting? – Salgar Sep 03 '14 at 16:35
-