I need to take a vector as an input in a C++ program.
The following is my code:
int main() {
vector<int> nums;
int target;
cin >> nums;
cin >> target;
Solution mine;
mine.twoSum(nums,target);
}
And following is the error shown by the compiler:
Line 32: Char 13: error: invalid operands to binary expression ('std::istream' (aka 'basic_istream<char>') and 'vector<int>')
cin >> nums;
~~~ ^ ~~~~