passing vector to function c++

后端 未结 6 1023
借酒劲吻你
借酒劲吻你 2020-12-30 15:32

I have a main.cpp test.h and test.cpp> I am trying to pass my vector through so i can use it in test.cpp but i keep getting errors.

   //file: main.cpp
    i         


        
6条回答
  •  悲&欢浪女
    2020-12-30 16:11

    A vector is not an array.

    int tester(vector &s)
    

    (pass as a reference to avoid copying or if you need to modify)

    You also need to modify your code inside the tester function to work correctly as a vector.

提交回复
热议问题