From: Darren Johns Newsgroups: comp.os.msdos.djgpp Subject: Re: gcc 2.7.2.1: Won't compile | or || symbols (really!) Date: 07 Sep 1998 13:58:54 +0100 Organization: University of Aberdeen, Scotland Lines: 50 Message-ID: References: <1998090623100300 DOT TAA28060 AT ladder01 DOT news DOT aol DOT com> NNTP-Posting-Host: trogon.csd.abdn.ac.uk To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk >Subject: Re: gcc 2.7.2.1: Won't compile | or || symbols (really!) >From: JAU-BING LIN >Date: Sun, 6 Sep 1998 02:33:54 -0500 (CDT) > > > >On Sat, 5 Sep 1998 richard AT wynne DOT demon DOT co DOT uk wrote: > >> Just installed gcc 2.7.2.1 (from djgpp distribution). Believe it or >> not, I can't get logical or bitwise OR (pipe symbol) to compile. Get >> message "parse error before character 0335", 335 being the (octal) >> ascii for the pipe character. For example, this won't compile: >> >> int main (int argc, char * argv[]) { >> if((argc == 1) || (argc == 2)) { >> return 1; >> } else { >> return o; >> } >> } > >I guess the fllowing may work without using OR > > 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; } /Darren. -- | To take no action is in itself taking an action, and to have no opinion is | |/-\| to have an opinion, so are we helpless in what goes on around us?? |/-\| |\-/|\-/|\-/|\- D Mark Johns. mailto:djohns AT csd DOT abdn DOT ac DOT uk -/|\-/|\-/|\-/| |_____________________ http://www.csd.abdn.ac.uk/~djohns ____________________|