Last active
November 11, 2016 11:53
-
-
Save tterb/acafc5696fcb84a7cfaa141130761986 to your computer and use it in GitHub Desktop.
Reading command-line arguments in C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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