This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Error: expected expression before return




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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]