theducks: (Default)
theducks ([personal profile] theducks) wrote2008-08-05 11:59 am

(no subject)

Dear LazyGDB..

Not knowing much about C, I find myself confused by the following, extrapolated from some code I didn't write:

Code:
#include <stdlib.h>
#include <signal.h>

int main(int argc, char **argv)
{

        char    opt;
        char    *options = "a:de:f:l:p:";

        opt = getopt(argc, argv, options);
        printf ("Opt: %d\n",opt);

}


Linux on PowerPC:
suffix:~# ./test -a fish
Opt: 97
suffix:~# ./test
Opt: 255


Linux on i686:
vitalstatistix:~# ./test -a fish
Opt: 97
vitalstatistix:~# ./test 
Opt: -1


What is the deal?

[identity profile] girlmitzi.livejournal.com 2008-08-05 04:19 am (UTC)(link)
I don't know what this means either but for some reason I just took off all my clothes...