Why is a C++ Vector called a Vector?

后端 未结 16 2369
情话喂你
情话喂你 2020-12-04 07:42

The question\'s pretty self-explanatory really. I know vaguely about vectors in maths, but I don\'t really see the link to C++ vectors.

16条回答
  •  [愿得一人]
    2020-12-04 07:57

    An excerpt from The C++ Programming Language by Bjarne Stroustrup:

    "One could argue that valarray should have been called vector because it is a traditional mathematical vector and that vector should have been called array. However, this is not the way the terminology evolved."

提交回复
热议问题