CHAR *username = [200];
should be this
char username[200];
And this
wcout << L"Hello, " << NameSamCompatible << L"!\n";
should be this
cout << "Hello, " << username << "!\n";
3
solved retrive username and domain with GetUserNameExA [closed]