Skip to content

Instantly share code, notes, and snippets.

@johnhmj

johnhmj/main.cpp

Last active Dec 6, 2017
Embed
What would you like to do?
#include <Windows.h>
//
// 1st way to avoid max conflict: undefine max from Windows.h
#ifdef max
#undef max
#endif
//
int wmain(int argc, wchar_t* argv[])
{
//
// PAUSE
cin.clear();
// 2nd way to avoid max conflict: undefine max from Windows.h
cin.ignore((std::numeric_limits<std::streamsize>::max)(), '\n');
cout << "press any key to continue...";
cin.get();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.