From: Endlisnis Newsgroups: comp.os.msdos.djgpp Subject: Re: gcc 2.7.2.1: Won't compile | or || symbols (really!) Date: Mon, 07 Sep 1998 19:04:02 -0300 Organization: NBTel Internet Lines: 34 Message-ID: <35F45852.49B75D82@unb.ca> References: <1998090623100300 DOT TAA28060 AT ladder01 DOT news DOT aol DOT com> NNTP-Posting-Host: fctnts05c61.nbnet.nb.ca Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Darren Johns wrote: > > int main (int argc, char * argv[]) > > { > > if (argc == 1) > > return 1; > > else if (argc == 2) > > return 1; > > else > > return 0; > > } > > Without trying it this should work as well: > int main (int argc, char * argv[]) > { > return (argc == 1); > return (argc == 2) > return 0; > } 1) You missed a ";" on the 2nd return. 2) All this does is evaluate whether (argc==1) and return that value, what you probably meant to say is: int main(int argc, char * argv[]) { return (argc == 1 || argc == 2); } -- (\/) Endlisnis (\/) s257m AT unb DOT ca Endlisnis AT GeoCities DOT com Endlis AT nbnet DOT nb DOT ca