#include #include #include #include #include #include "boom.h" /* * author: burt * date: 24 aug 2015 * pledge: this is my own work, unless otherwise noted * * this is a template. change name and continue work */ /* globals go here */ int g_debug = 0 ; // global declaration; extern definition in header int g_vebose = 0 ; /* defines go here, in SHOUTY_CASE */ #define N_DEFAULT 10 #define USAGE_MESSAGE "usage: boom [-vu] [-n num] " int main(int argc, char * argv[]) { int ch ; int n = N_DEFAULT ; while ((ch = getopt(argc, argv, "D:n:vu")) != -1) { switch(ch) { case 'D': g_debug = atoi(optarg) ; break ; case 'v': g_verbose = 1 ; break ; default: printf("%s\n", USAGE_MESSAGE) ; return 0 ; } } argc -= optind; argv += optind; /* example of an assertion */ assert(n>0) ; /* * your code here * */ return 0 ; }