Software Development Network>> VS Express Editions>> C# : What is wrong with this?
{
}
Mattias,
Thank you; it works.
However,
Why does
return @"Mystring";
work without requiring
return new string @"My String";
Becuase it's a string literal - the compiler knows that things inside double quotes are strings. It can't know that what you happen to write inside those curly braces should be interpreted as an int[] unless you specify the type.
You have to write
return new int[] {31, ....
Thanks, once more.
I should remember that C# does not have the VB Variant data type.
C# : What is wrong with this?
Rajat Solanki
Mattias,
Thank you; it works.
However,
Why does
return @"Mystring";
work without requiring
return new string @"My String";
Matti Niskasaari
Becuase it's a string literal - the compiler knows that things inside double quotes are strings. It can't know that what you happen to write inside those curly braces should be interpreted as an int[] unless you specify the type.
Nick Burnett
You have to write
return new int[] {31, ....
Tim Wright
Thanks, once more.
I should remember that C# does not have the VB Variant data type.