[ACCEPTED]-Is there an equivalent C# syntax for C's inline anonymous struct definition?-equivalent
Accepted answer
This is not possible in C#, however you 5 can define an instance of an anonymous type 4 like this:
var x = new { SomeField = 1, SomeOtherField = "Two" };
This would effectively be the 3 same, giving you an instance of a type that 2 is specific to that variable and cannot 1 used outside the variable's scope.
Simple answer: No, it is not possible.
0
Would this not help ?
(string, string, int) retVal;
retVal.Item1 = "A String";
retVal.Item2 = "Another String"
retVal.Item3 = 4;
0
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.