Skip to content

Instantly share code, notes, and snippets.

@jonahgeorge
Last active December 24, 2015 05:18
Show Gist options
  • Save jonahgeorge/6749232 to your computer and use it in GitHub Desktop.
Save jonahgeorge/6749232 to your computer and use it in GitHub Desktop.
Command Line Options
#include <iostream>
#include <cstring>
using namespace std;
int main (int argc, char *argv[]) {
cout << "Number of args: " << argc << endl;
cout << "Name of program: " << argv[0] << endl;
if (argc > 1) {
cout << "2nd argument: " << argv[1] << endl;
}
return 0;
}
\033[22;30m - black
\033[22;31m - red
\033[22;32m - green
\033[22;33m - brown
\033[22;34m - blue
\033[22;35m - magenta
\033[22;36m - cyan
\033[22;37m - gray
\033[01;30m - dark gray
\033[01;31m - light red
\033[01;32m - light green
\033[01;33m - yellow
\033[01;34m - light blue
\033[01;35m - light magenta
\033[01;36m - light cyan
\033[01;37m - white
e.g. for light blue
printf("\033[01;34m Hello World");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment