Hello i got a problem with my code here.
LPCSTR mergeString(LPCSTR firstString, std::string secondString)
{
string convertedString = ConvertString(firstString);
LPCSTR mergedString;
int i = convertedString.size();
convertedString.insert(i, secondString);
mergedString = (convertedString.c_str());
return mergedString;
}
void GetFiles(LPCSTR path)
{
WIN32_FIND_DATA File_Data;
LPCSTR lPath = mergeString(path,"\\*.txt");
FindFirstFile(lPath, &File_Data);
wcout << File_Data.cFileName;
}
You pass in the path you want to use in the GetFiles(LPCSTR path) Then i use the mergestring function to merge together the path with a extension (\*.txt) everything works except when it returns the LPCSTR then its just a lot of wierd characters and i dont know why or is it a better way to do this?