KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
If C# can cast an int to an object, why not an int[] to an object[]? Simple Program Example: void Main() { var a = new String[]{"0", "1"}; var b = new int[]{0, 1}; AssertMoreThan1(a); // No Exception AssertMoreThan1(b); // Exception } static void AssertMoreThan1(params object[] v){ if(v.Length == 1){ throw new Exception("Too Few Parameters"); } }
Tags (comma-separated)
Save Edits
Cancel