I used function FindFirstFile() but i received only memory address – not a file name.
#include <stdafx.h>
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
WIN32_FIND_DATA File_Data;
FindFirstFile(TEXT("C:\\Users\\user\\Desktop\\temp\\*.tmp"), &File_Data);
cout<<File_Data.cFileName;
cin.get();
return 0;
}
Can anybody help me?
You are probably compiling using the Unicode character set, which means that windows API’s will default all character strings to the wide version (wchar_t vs char). Try using the wide output version of
cout(wcout):