amateur: comparing strings
Pavel Hilser

Sorry for this question. I was googling a lot, but have not found anything relevant :-/.
I have to compare two strings, if they are exact the same, but I have almost none experiences with strings in C. :(

miran
Pavel Hilser

ok, stupid me, thanx for kicking in the right direction :)

Goalie Ca
James Stanley

Forgive me, but what's wrong with '=='?

Paul whoknows
Quote:

Forgive me, but what's wrong with '=='?

You can't compare two strings using the "==" operator in C.Because in C a strings is an array of chars, so you have to compara each char in the array one by one.You can implement your own function to do that using a pointer to char, or you can use the ANSI C strcmp and stricmp functions.

Thread #588385. Printed from Allegro.cc