hi everyone i have a problem with this code below. when i try to read all the files in a directory i can but when i try to put them in a vector, it doesn't work, all the elements in the vector become the last element added. I'm not sure what the issue is but im sure that it has something to do with pointers and how i am adding them into the vector. Any Help Would be great. Thank You
void search_directory(char * path,vector<char*>* temp)
{
WIN32_FIND_DATA file;
HANDLE hFind = FindFirstFile(path , &file);
do
{
temp->push_back(file.cFileName);
}
while
(FindNextFile(hFind, &file));
for (int i=0; i <temp->size();i++)
{
cout << temp->at(i);
}
}