I have a vector
vector<int> vec;
it's storing random numbers {5, 7, 8, 9, 13, 15, 17}
and I have a vector that is evaluating the previous vector's numbers as 1 or 0 if they are a prime number or not
vector< int> vec_prime_number;
so for the previous it would be {1, 1, 0, 0, 1, 0, 1}
I'm trying to use the count function to save only the prime numbers in it. And I'm having some problems with doing it.
Ideally, I would like to make it so that vec has {5, 7, 13, 17} //in other words, only prime numbers in it
I've tried stuff like
int cnt = count(vec.begin(), vec.end(), vec_prime_number())
but I can't get any of it to work. Any ideas on how to get count to store only the prime numbers?