What is the syntax in order to pass an array that is not predefined in a function as operand?
For example i have this function:
void kilos(int percentage[2],char liquid[2][4]);
So if i make 2 different arrays(declare and define) and pass them as operands everything work properly.
How can this work if i do not want to make the arrays before the call of the function?
If i have the variables i want to pass and i do not have a and also do not want to make the arrays before i call the function.How can i do it all at once?
Is the only solution to analyze the operands and not use arrays?
this is want i guess. so there is no way that i could declare(this can happen) and initialize the arrays as i call the function inside the parenthesis.Something like:
kyrpav:
this is want i guess. so there is no way that i could declare(this can happen) and initialize the arrays as i call the function inside the parenthesis.Something like:
No, but you could define a local or global const array containing the values and use that as the argument.