I am writing a cross-platform compatible function in C++ that creates directories based on input filenames. I need to know if the machine is Linux or windows and use the appropr
By default, Visual Studio #defines _WIN32 in the preprocessor project settings.
#define
_WIN32
So you can use
// _WIN32 = we're in windows #ifdef _WIN32 // Windows #else // Not windows #endif