Windowsの環境変数%USERPROFILE%の値をC++から取る
以下がソースコード
#include
#include
#include
using namespace std;
int main()
{
char profilepath[250];
ExpandEnvironmentStrings("%userprofile%",profilepath,250);
cout << profilepath;
getch();
return 0;
}
以下がソースコード
#include
#include
#include
using namespace std;
int main()
{
char profilepath[250];
ExpandEnvironmentStrings("%userprofile%",profilepath,250);
cout << profilepath;
getch();
return 0;
}