Vector | Sololearn: Learn to code for FREE!

0

Vector

How to return a vector in a function

3/31/2022 11:04:07 PM

Basil Uche

4 Answers

New Answer

+4

Your binary() function has return type `int`, so you can't return a std::vector from it. Change the return type of binary() to `vector<int>`. Also, on lines 50, 68 and 60, you are using the name `and` for your variable. `and` is a keyword in C++, so you can't use it as a variable name. Change it to something else.

0

Jay Matthews Sir why's the vector not returning here https://code.sololearn.com/c5nDeIo5twO3/?ref=app

0

My binary function