E
Edward Diener
If I write:
int[] x = { 1 };
that is fine with the compiler, but if I try to declare the array as const,
meaning that it will not be changed:
const int[] x = { 1 };
I receive the error message:
error CS0623: Array initializers can only be used in a variable or field
initializer. Try using a new expression instead.
So now I try:
const int[] x = new int[1] { 1 };
and I get:
error CS0133: The expression being assigned to
'Sis.Messaging.BasicSendersReceivers.TestTcpHandler.itest' must be constant
int[] x = { 1 };
that is fine with the compiler, but if I try to declare the array as const,
meaning that it will not be changed:
const int[] x = { 1 };
I receive the error message:
error CS0623: Array initializers can only be used in a variable or field
initializer. Try using a new expression instead.
So now I try:
const int[] x = new int[1] { 1 };
and I get:
error CS0133: The expression being assigned to
'Sis.Messaging.BasicSendersReceivers.TestTcpHandler.itest' must be constant