Mail Archives: djgpp/1998/09/07/21:57:22
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
- Raw text -