Hi forum, I was wondering if someone could help me with my code. I am trying to code a program that compares two integer vectors to see if they have the same set of numbers regardless of their sequence. The code needs at least one vector and one boolean function to determine if the vectors have the same set of numbers. This is what i have so far to test if their size is the same. Can someone explain why the code runs, but then crashes?

#include <iostream>

#include <vector>

using namespace std;

bool same_set(vector<int> a, vector<int> b)

{

if(a.size() != b.size()) //Verify that the vectors are the same size.

return false;

else return true;

}

int main()

{

int value;

vector <int> a;

cout << "Please enter a series of numbers: ";

while(!cin.fail())

{

a.push_back(value);

}

return 0;

}