Array must be indexed
#3

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...

Код:
if(strcmp(reason, "Weapon Licence", true) == 0) // Returns 0 if string match 
{
 // Insert Funky Ass Code Here
}
Simple.
Reply


Messages In This Thread
Array must be indexed - by Takumi.WS - 15.08.2009, 15:21
Re: Array must be indexed - by Takumi.WS - 15.08.2009, 15:58
Re: Array must be indexed - by [BDC]Scarface - 15.08.2009, 16:39

Forum Jump:


Users browsing this thread: 1 Guest(s)