Skip to content

Instantly share code, notes, and snippets.

@tterb
Last active November 11, 2016 11:53
Show Gist options
  • Save tterb/acafc5696fcb84a7cfaa141130761986 to your computer and use it in GitHub Desktop.
Save tterb/acafc5696fcb84a7cfaa141130761986 to your computer and use it in GitHub Desktop.
Reading command-line arguments in C++
int main(int argc, char* argv[]){
if(argc > 1) //if there is an argument
/* Do something */
string firstArg = argv[1];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment