-3

I am trying to store two related integers together in the one data structure. For example, I have a Care Registration Number and a User ID that I want to store together. What's the best way to do this? A two dimensional array? Or is there another option?

MattTheHack
  • 1,346
  • 7
  • 26
  • 48

1 Answers1

-1

I would use a struct or a class:

public struct User
{
    public int UserID;
    public int RegistrationNumber;
}

EDIT: for the discussion on struct vs. class I think this is a good answer.

Community
  • 1
  • 1
Fabian H.
  • 796
  • 5
  • 18