Are arrays reference-type or value-type in PAWN?
#1

The reason for this question is that if the example code will alter the array from the argument or do I have to explicitly use the '&' reference operator?

pawn Code:
stock SomeFunction(somearray[], len = sizeof(somearray))
{
    somearray[0] = EOS;
    strcat(somearray, "Modified Array", len);
}

new anotherarray[16] = {'A', 'R', 'R', 'A', 'Y'}
SomeFunction(anotherarray, 16);
//Well now will the value of the array becomes "Modified Array" or stays "Array"?
// If it doesn't I have to reference it right?
Reply


Messages In This Thread
Are arrays reference-type or value-type in PAWN? - by Cameryn - 16.06.2013, 19:44
Re: Are arrays reference-type or value-type in PAWN? - by KingHual - 16.06.2013, 19:47
Re: Are arrays reference-type or value-type in PAWN? - by Cameryn - 16.06.2013, 19:50

Forum Jump:


Users browsing this thread: 1 Guest(s)