C++ std::vector vs array in the real world

后端 未结 7 1065
逝去的感伤
逝去的感伤 2020-11-27 16:56

I\'m new to C++. I\'m reading "Beginning C++ Through Game Programming" by Michael Dawson. However, I\'m not new to programming in general. I just finished a cha

7条回答
  •  悲哀的现实
    2020-11-27 17:49

    A std::vector is just a resizable array. It's not much more than that. It's not something you would learn in a Data Structures class, because it isn't an intelligent data structure.

    In the real world, I see a lot of arrays. But I also see a lot of legacy codebases that use "C with Classes"-style C++ programming. That doesn't mean that you should program that way.

提交回复
热议问题