T
Tony Johansson
Hello!
This construction
int? op1 = 5;
int result = op1 * 2;
gived a compile error with
Error 1 Cannot implicitly convert type 'int?' to 'int'. An explicit
conversion exists (are you missing a cast?)
C:\tony\ConsoleApplication1\ConsoleApplication1\Program.cs 12 26
ConsoleApplication1
If I instead have this construction
int? op1 = 5;
int result = op1 * 2 ?? 12;
Then no compile error will occur.
I mean that because I don't have a nullable type for result it should
give a compile error as the first example did.
//Tony
This construction
int? op1 = 5;
int result = op1 * 2;
gived a compile error with
Error 1 Cannot implicitly convert type 'int?' to 'int'. An explicit
conversion exists (are you missing a cast?)
C:\tony\ConsoleApplication1\ConsoleApplication1\Program.cs 12 26
ConsoleApplication1
If I instead have this construction
int? op1 = 5;
int result = op1 * 2 ?? 12;
Then no compile error will occur.
I mean that because I don't have a nullable type for result it should
give a compile error as the first example did.
//Tony