-2

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.

chamibuddhika
  • 1,419
  • 2
  • 20
  • 36
  • 2
    A `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 Answers1

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