I’m trying to translate an array declaration from VB.Net to C#, and I’m struggling. The Vb code is in the format:
dim variableName() as typeName = {}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sounds like you want:
For example:
Or using
varand an explicitly typed array creation expression:Or using
varand an implicitly typed array (not so good for an empty array, of course):