Error: expected expression before return

Dave Williss dwilliss@microimages.com
Thu Mar 15 16:17:00 GMT 2007



Itzhack Goldberg wrote:
> The following program doesn't pass compliation:
>
> #include <stdio.h>
> int izik()
> {
>       ( 1 == 1 ) && return 0 || return 1 ;
> }
> int main()
> {
>       int rtrn = izik();
> }
>
>
> The error is: error: expected expression before 'return'
>
>   
int izik()
{
    return ( 1 == 1) ? 0 : 1;
}

This is C, not Perl :-)

Shalom



More information about the Gcc-help mailing list