OiO.lk Blog C# Is it possible to access a parameter of a function from another function in C?
C#

Is it possible to access a parameter of a function from another function in C?


Is it possible to access the value of a variable from a function within another function. You can assume that the first function is called in the main one.
Here is an example:

int foo (int x) {
    int z;
    // Do things...
    return 0;
}

int bar () {
    // Access value of z here.
    // Do more things...
    return 0;
}



You need to sign in to view this answers

Exit mobile version