Skip to content

Instantly share code, notes, and snippets.

@johnhmj
Last active December 6, 2017 04:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnhmj/e994d4ae7e30277cfe2e076537db7f8d to your computer and use it in GitHub Desktop.
Save johnhmj/e994d4ae7e30277cfe2e076537db7f8d to your computer and use it in GitHub Desktop.
#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