I am having a Dictionary<int,ulong>
, where I want to store StudentId
and his/her registered courses
(which is guaranteed to be 2).
Now, As you can see, instead of saving 2 courseids into a List
of Integers, i want to store them as ulong
as ulong
occupy 64 bits and int
occupy 32 bits.
So my question is, how can i combine these 2 integer ids and store them into a ulong
variable. I've tried with some Bitwise operation and shifting but unable to figure it out.