anyone who can help and is familiar with the Pike language.
I am currently studying the Pike language and I would like to implement a void function that calculates the factorial of a given number "N". The "factorial" function should accept two parameters: the "N" parameter, which represents the calculation limit, and the "RESPONSE" parameter, which will store the calculated factorial value to be returned to the calling program.
I have searched extensively, but I couldn't find any information regarding passing parameters by reference in Pike. It seems like a rather obscure topic or perhaps not widely discussed. I have attempted various parameter passing techniques such as using "*", "&", "ref", "object", "array[][" but unfortunately, none of them worked. I even tried to simulate the pass-by-reference style used in the TCL language, but it also failed to produce the desired result.
If anyone has any insights or suggestions on how to achieve pass-by-reference behavior in Pike, I would greatly appreciate your assistance.
void factorial (int N, ref int FAT) {
for (int I = 1; I <= N; I++) {
FAT *= I;
}
}