I am basically c++ guy,now learning c#. While array declaration I found that c# expects the square brackets after the type unlike c,c++. Is there any reason c# language specification is this way?
The only good reason I can think of is to make a clear indication of the types of list1 and list2 in this construction:
In C#:
int[] list1, list2;
list2 is an array of ints.
In C++:
int list1[], list2;
list2 is an int.
Readability is key here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With