Is there a way in C++ to get a sub array from an array?

后端 未结 2 1180
無奈伤痛
無奈伤痛 2020-12-17 20:07

I\'m having a brain fart at the moment and I am looking for a fast way to take an array and pass half of it to a function. If I had an array A of ten elements, in some langu

2条回答
  •  情书的邮戳
    2020-12-17 20:42

    i also had the same use but instead i used vector and used the syntax

    vector  a(10);
    // for example to use by removing first element
    
    a = std::vector(a.begin() + 1, a.end())
    //its ur turn to change the size
    

提交回复
热议问题