/*MerryChristmas.c*/

Paul paul at all-the-johnsons.co.uk
Wed Dec 24 23:53:30 UTC 2008


Hi,

> /*MerryChristmas.c*/
> void main (int argc, char* argv[])

main has never and will never return anything other than an int. It's in
the standard!!!!

> {
>     printf("\n Merry Christmas! \n");
>     if (strcmp(argv[1],"girl") == 0)    /*general idea*/
>         printf("Kisses! \n");
>     else
>         printf("Hugs! \n");
> }

Ouch! What happens though if argv[1] is "Girl" or "gIrl" (you get the
idea). Surely something like

if (strcmp(tolower(argv[1])),"girl)

would make more sense and catch the problems. However, we don't take
into account here if argv[1] is null, so a catch is required..

Oh dear. I need sleep.

MERRY CHRISTMAS FOLKS!!!!!

TTFN

Paul
-- 
Sie können mich aufreizen und wirklich heiß machen!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/fedora-devel-list/attachments/20081224/0953ac90/attachment.sig>


More information about the fedora-devel-list mailing list