C
C#12mo ago
AdiZ

✅ Declaring a Dictionary as a Member Variable

Trying to define a dictionary as a member variable in a class. Getting this error:
Array initializers can only be used in a variable or field initializer. Try using a new expression instead.
Can only use array initializer expressions to assign to array types. Try using a new expression instead.
Array initializers can only be used in a variable or field initializer. Try using a new expression instead.
Can only use array initializer expressions to assign to array types. Try using a new expression instead.
New to C# - what's happening here?
1 Reply
AdiZ
AdiZOP12mo ago
Oops I forgot new()
Want results from more Discord servers?
Add your server