Mail Archives: djgpp/1998/09/07/09:16:11
>Subject: Re: gcc 2.7.2.1: Won't compile | or || symbols (really!)
>From: JAU-BING LIN <jl1013 AT broncho DOT ucok DOT edu>
>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 ____________________|
- Raw text -