title: Determine if Linux or Windows in C++
body: <p>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 appropriate forward or back slash. For the following code below, if the machine is Linux then <code>isLinux = true</code>. How do I determine the OS?  </p>
  
  <pre><code>bool isLinux;
  std::string slash;
  std::string directoryName;
  
  if isLinux
     slash = "/";
  else
     slash = "\\";
  end
  
  boost::filesystem::create_directory (full_path.native_directory_string() + slash + directoryName); 
  </code></pre>