'Best way to search for vector values in a file

for a project, I'm trying to use my randomly generated vector to compare to a given CSV file full of int data. My vector is 6 random numbers, I need to read my csv files, and check if those numbers within my vector exist in all of the files.

What is the best way to access my vector one by one, and compare to all files? my code below worked fine when I originally used an array to store the random numbers but after changing over to a vector, it doesnt seem to work.

I'm very new to C++ for context

int csv_reader() {
string line; 
vector<int> numbers;
int filecontents = 0;

num_gen(numbers);
    
std::string path_to_dir = "example/directory/to/csv's";

for( const auto & entry : std::filesystem::directory_iterator( path_to_dir )) {
    if (entry.path().extension().string() != ".csv") continue;
    ifstream file(entry.path());

    if(file.is_open())
    {
        while(getline(file, line))
        {
            file >> filecontents;

            for(int i = 0; i > numbers.size(); i++)
            {
            if(filecontents == numbers.at(i))
            cout << "success";
            else
            cout << "doesnt exist";    
            }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source