[REP++] Returned arrays
#2

From my understanding, arrays are passed by as reference always. Either way if you meant something like GetPlayerName function to return the the name instead of referencing it, then it's the same thing as returning any other array.

Code:
main()
{
   new mainstring[128];
   format(mainstring, sizeof(mainstring), "%s", funketup());
   printf("%s is same as %s", mainstring, funketup());
}

funketup()
{
   new str[128] = "'this is a returned string";
   
   format(sizeof(str), "%s and we do something naw with it %i'", GetTickCount());

   return str;
}
Meaningless example, hope that clears shit up.
Reply


Messages In This Thread
[REP++] Returned arrays - by buburuzu19 - 18.06.2017, 12:50
Re: [REP++] Returned arrays - by Hansrutger - 18.06.2017, 13:21

Forum Jump:


Users browsing this thread: 2 Guest(s)