How is memory allocated in int array

前端 未结 5 1688
南笙
南笙 2021-01-05 06:28

How much space does a int array take up? Or how much space (in bytes) does a int array consumes that looks something like this:

 int[] SampleArray=new int[         


        
5条回答
  •  时光说笑
    2021-01-05 07:04

    In C++, how much memory new int[4]{1, 2, 3, 4} actually allocates is implementation-defined but the size of the array will be sizeof(int)*4.

提交回复
热议问题