Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
C# を勉強しているときに、次の疑問が生じました。C# では、配列は宣言時に参照型であるため、常にヒープに割り当てられていると思います。したがって、次の方法で配列を宣言する場合:
int[] arr1 = {1,2,3}; int[] arr2 = new int[3] { 1, 2, 3 };
それらの間に違いはありますか?
そして、C++ のように配列を宣言できint arr[100];ますか?(初期化せず、new キーワードを使用せずに)後で値を割り当てます。
int arr[100];