Mega Code Archive

 
Categories / C / Code Snippets
 

Check the command line parameters

#include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { if(argc!=2) { printf("You forgot to type your name.\n"); exit(1); } printf("Superman %s", argv[1]); return 0; }