I have a local variable in my function main
. Can data of that variable be passed to any function?
For example, move from main
to function x
, the value of variable k
I have a local variable in my function main
. Can data of that variable be passed to any function?
For example, move from main
to function x
, the value of variable k
If the 'function x' is called within the main () function, this is possible.
Main()
{
variable k;
k= valor;
FuncionX(k);
}
otherwise you need the variable 'k' to be global.
variable k;
Main()
{
k= valor;
}
FuncionX(variable)
{
k= valor;
...
}