In #C, how do I get an int array to allow / use nullable ints?
int? numberOfValues = null;
int[] anArray = new int[numberOfValues];
I recieve an error:
Cannot implicitly convert type 'int?' to 'int'. An explicit conversion exists (are you missing a cast?)
[#C] How do I get an int array to allow / use nullable ints?
well you need use the explicit conversion see the code
int? numberOfValues = null;
int[] anArray = new int[System.Convert.ToInt32(numberOfValue...
local florist
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment