vector::push_back vs vector::operator[]

后端 未结 2 940
迷失自我
迷失自我 2020-12-15 02:19

Below in c++ program,

include
#include
using namespace std;

int main()
{
     vector numbers;

    n         


        
2条回答
  •  春和景丽
    2020-12-15 02:47

    std::vector::operator[]: "access specified element"

    std::vector::push_back: "adds an element to the end"

    I'm so amazing at looking at c++ references. You should try it.

提交回复
热议问题