15.08.2009, 16:39
You must use the strcmp (String Compare) function.
Reason: A string is an array that contains characters. Eg. if your string said "Yes" it is stored like this... reason[0] = "Y", reason[1] = "e", reason[2] = "s" (then the last two chars are /0, to identify the end of a string). If you were to make this work the current way, you could only check one character at a time...
Eg of strcmp...
Simple.
Reason: A string is an array that contains characters. Eg. if your string said "Yes" it is stored like this... reason[0] = "Y", reason[1] = "e", reason[2] = "s" (then the last two chars are /0, to identify the end of a string). If you were to make this work the current way, you could only check one character at a time...
Eg of strcmp...
Код:
if(strcmp(reason, "Weapon Licence", true) == 0) // Returns 0 if string match { // Insert Funky Ass Code Here }