c++获取当前目录

    char p_filepath[MAX_PATH];
TCHAR w_FilePath[MAX_PATH];
DWORD len
= GetModuleFileName(NULL, w_FilePath, MAX_PATH);
if (len > 0)
{
len
= WideCharToMultiByte(CP_ACP, 0, w_FilePath, len, p_filepath,
sizeof(p_filepath)-1, NULL, NULL);
if( len > 0 )
{
p_filepath[len]
= '\0';
strcat( p_filepath,
"\\tmp.bmp" );
}
}

  

你可能感兴趣的:(C++)