one
Code:
for ( x = 1 ; x < argc ; x++ )
{
printf ("%i %s\n", x, argv[x]);
if (argv[x] == "joe")
printf ("You said joe\n");
}
If I put this in my main() function, compile it, and say:
$ ./compiledbinary joe
It does
not print back 'You said joe'. However, it does print
'1 joe'
Which means that printf 'can read' argv[x], but it seems == 'can't' compare argv[x] with a static string. If I make a variable called
foo and put "joe" (char *foo = "joe";) in it, it _does_ work.
:confused:
two
Code:
char a;
switch (a)
{
case 'A':
case 'B':
CatBillGatesDevNull ();
break;
case 'C':
Joseph ();
break;
default:
Ko ();
break;
}
This is perfectly legal, but is it possible to switch strings? I think so, but I wouldn't know how. It'd be odd that just for strings, we'd be stuck with a whole lot of
if statements :)
three
I'd like to write KDE apps with Kdevelop in
C. What approach is there?