Hey guys/gals,
When using command line arguments how would you handle if there is nothing typed in the command. How do I quit the program if the argument is left blank?
example code:
Code:int main(int argc, char *argv[]) { y = 0; x = atoi(argv[1]); //so here if x is nothing...there is nothing placed for the arg... while(y<x) //how do I make it so it doesn't go through this loop? { //do stuff } return 0;
}