Returning string from array
#1

Code:
new strArr[][] = {
    "one",
    "two",
    "three"
};

stock GetStringArray(index)
{
    return strArr[index];
}
Why does print(GetStringArray(0)); show "(null)"?
Reply
#2

I don't know what the hell is that, but its printed $one $one $one for me, but i see that your stock function is pointless, you can use it directly or using a define.

Code:
#define getNum(%0)	numberPrint[%0]

new const numberPrint[][] = {
	"one",
	"two",
	"three"
}
getNum(0), getNum(1), getNum(2)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)