1)const int[] array={1,2,3,4}; //this gives below error
引用類型常數初始化和Array concetanation
"Error 1 'ConsoleApplication1.Main.array' is of type 'int[]'.
A const field of a reference type other than string can only be initialized with null"
在根據錯誤messeagge我看來,這是不meaningfull用於參考types.Am我錯常量?
2)如何連接int數組?例如:
int[] x={1,2,3} + {4,5,6};
我知道+運算符將無法正常工作,所以將它作爲字符串的最佳方式是什麼?
我沒有說過性能點。我只是對可讀性和清晰度更感興趣。 – Freshblood 2010-07-19 12:45:39