Advertisement
B1KMusic

Untitled

Sep 2nd, 2015
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. void error(char *msg){
  2.     fputs(msg, stderr);
  3. }
  4.  
  5. int main(int argc, char **argv){
  6.     if (argc < 1){
  7.         error("Usage: ./my_program [option] [file]");
  8.         return 1; // The OS/Shell will interpret this as a failure, sometimes saying "[program] returned with an exit status of 1"
  9.     }
  10.     // [do stuff]
  11.     return 0; // The OS/Shell will interpret this as a success
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement