Static array vs. dynamic array in C++

后端 未结 11 1535
遥遥无期
遥遥无期 2020-11-22 10:43

What is the difference between a static array and a dynamic array in C++?

I have to do an assignment for my class and it says not to use static arrays, only dynamic

11条回答
  •  隐瞒了意图╮
    2020-11-22 11:17

    Static array :Efficiency. No dynamic allocation or deallocation is required.

    Arrays declared in C, C++ in function including static modifier are static. Example: static int foo[5];

提交回复
热议问题