"Bill Cunningham" <nospam@[EMAIL PROTECTED]
> writes:
> "rio" <a@[EMAIL PROTECTED]
> wrote in message
> news:4822d8eb$0$41661$4fafbaef@[EMAIL PROTECTED]
>> i like below
>>
>> #include <stdio.h>
>> #include <stdlib.h>
>>
>> int main(int argc, char **argv)
>> {double x, y;
>>
>> if (argc!=3) { fprintf(stderr,"usage error\n"); return -1;}
>>
>> x=strtod(argv[1], 0);
>> y=strtod(argv[2], 0);
>>
>> return (x!=0.0) ?
>> (printf("%.2f\n", y/x), 0): (printf("Error: x==0\n"), -1)
;
>> }
>
> This is the part that goes over my head with my knowledge.
>
> return (x!=0.0) ? /*what's the ? and 0.0 for */
>
> There are things in C, shortcuts that I haven't grasped yet like += and
?: I
> do things the long way right now.
I believe "rio" is pulling your leg. His code is gratuitously
obfuscated.
--
Keith Thompson (The_Other_Keith) <kst-u@[EMAIL PROTECTED]
>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"


|