I have a problem to make use of AngelScripts global functions inside a C++-application.
In my .cpp file I have the function:
int multi(int x, int y)
{
int z = x * y;
cout << x << endl;
cout << y << endl;
return z;
}
I'm registering it by using:
engine->RegisterGlobalFunction("int multi(int &out, int &out)", asFUNCTION(multi), asCALL_CDECL);
In my .as file I call the function like this:
multi(1, 2);
So in this case I want x to be 1 and y to be 2, but when I print the values with cout it's something like x = 4318096 and y = 4318100.
I can't figure out where my mistake is. I appreciate any help I can get.