From: "Mike Moore" Newsgroups: comp.os.msdos.djgpp Subject: The Endless Pursuit of Elegance Date: Sat, 2 Jan 1999 20:19:27 -0000 X-Posted-Path-Was: not-for-mail X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.0810.800 X-ELN-Date: 2 Jan 1999 20:19:31 GMT X-ELN-Insert-Date: Sat Jan 2 12:25:08 1999 Organization: EarthLink Network, Inc. X-Newsreader: Microsoft Outlook Express 5.00.0810.800 X-MSMail-Priority: Normal Lines: 27 NNTP-Posting-Host: sdn-ar-001midetrp306.dialsprint.net Message-ID: <76lv0j$m21$1@birch.prod.itd.earthlink.net> To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Greetings, fellow DJGPP users! I'm making a little CD player using the BCD library. It accepts command line arguments, and I have this monstrous if-else loop that figures out what argument the user typed: if(strcmp(argv[1],"play")==0) bcd_play_track(atoi(argv[2])); else if(strcmp(argv[1],"stop")==0) bcd_stop(); else if(strcmp(argv[1],"resume")==0) bcd_resume(); etc., etc., ad nauseum. My question: is there a better way to do this kinda thing? -- /* Copyleft (C) Mike */ #include printf("In wind0ze, no one can hear you scream."); return (0);