Skip to content

Instantly share code, notes, and snippets.

@IvelleGames
Last active October 26, 2017 20:13
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IvelleGames/38f3f0cd0a6b63301ef7c62b3d8cb51f to your computer and use it in GitHub Desktop.
Save IvelleGames/38f3f0cd0a6b63301ef7c62b3d8cb51f to your computer and use it in GitHub Desktop.
cserver win
#include <cstdlib>
#include <cstring>
int main(int argc, char **argv) {
char str[1024];
#ifdef __linux__
strcpy(str, "/opt/google/chrome/chrome");
#endif
#ifdef _WIN32
strcpy(str, "start chrome.exe ");
#endif
strcat(str, " --allow-file-access-from-files ");
strcat(str, argv[1]);
#ifdef __linux__
strcat(str, " &");
#endif
std::system(str);
return EXIT_SUCCESS;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment