05.07.2013, 19:56
Hello There,
I've a problem with strings inside enums.
when using functions like (strcat or cache_get_field and functions that writes in a string), the strings' always null.
only when using format() had worked. (according to what i've tested)
here is the code:
Is there anything i've made done or it can't be done?
Thanks.
I've a problem with strings inside enums.
when using functions like (strcat or cache_get_field and functions that writes in a string), the strings' always null.
only when using format() had worked. (according to what i've tested)
here is the code:
pawn Code:
enum enumz
{
str1[50],
str2[50]
};
public OnFilterScriptInit()
{
new test[enumz];
new das[50] = "HI STR1";
new das2[50] = "HI STR2";
strcat(test[str1], das); // doesn't work :x
strcat(test[str2], das2); // doesn't work :x
printf("%s || %s", das, test[str1]); // prints "HI STR1 || "
printf("%s || %s", das2, test[str2]); // prints "HI STR2 || "
printf("_______________________________");
format(test[str1], 50, "%s", das); // works
format(test[str2], 50, "%s", das2); // works
printf("%s || %s", das, test[str1]); // prints "HI STR1 || HI STR1"
printf("%s || %s", das2, test[str2]); // prints "HI STR2 || HI STR2"
}
Thanks.