Hi im in the process of learning C and there is one thing that I want to know and cant seem to find in any books or online (i dont really know the terminology that well)
basically say i have my main function which calls 2 functions. In the example below, presume function1 returns an integer. how can I get this integer to be passed as an argument in function 2.
main()
{
function1(x,y)
function2(z)
}
e.g. i want z to be the result of function 1.
I know I could just call function 2 from within function 1 but this gets messy when you have lots of functions.
would global variables work?