Насчёт С не знаю, но на С++ (а значит, наверное, и на С) так: #include <iostream> #include <stdio.h> using std::cout; using std::endl; typedef enum { enSuccess, enWrongCmdLine, enFileOpenError } __ExitCodes; int main(int argc, char **argv) { if(argc != 3) { cout<<"Usage: "<<argv[0]<<" <in_file> <out_file>"<<endl; return enWrongCmdLine; }