Condition to choose between Class and struct

  • Thread starter Thread starter NotYetaNurd
  • Start date Start date
N

NotYetaNurd

Hi all,
I need a collection of objects
--which holds just two variables one string and one intptr
--the number of objects @ any point will not exceed 40 or 50 ...
Should i go for a struct or a class..Plz advice me in this regard

Regards,
 
NotYetaNurd said:
I need a collection of objects
--which holds just two variables one string and one intptr
--the number of objects @ any point will not exceed 40 or 50 ...
Should i go for a struct or a class..Plz advice me in this regard

Well, the real question is: do you want value type semantics, or
reference type semantics? Do you want different callers to be able to
easily get hold of copies of the values and change them without
affecting the originals, or do you want changes in the originals to be
visible to everyone looking at that instance?
 
Back
Top