0

How I call a function in other function. Not main

11th Nov 2016, 7:39 PM
Rose G
Rose G - avatar
3 Respostas
+ 2
One make sure you have the function definition or have the function be above main and call it like this. Int apples() { Return 0; } Int main() { apples() } If a function your calling had parameters maker sure you include then inside the call (where you see just apples()) Otherwise it will crash. Secondly if you have your function returning data make sure you have something like this a = apples(); What ever the return data is will be stored in that variable in this case it's a
12th Nov 2016, 3:32 AM
Myleek Chase
Myleek Chase - avatar
+ 1
It works the same whether you're calling the function in main or in another function. Every function you define in your program or include from a library can be called anywhere in the program.
11th Nov 2016, 8:34 PM
Mateo
Mateo - avatar
+ 1
You just have to put the "called function" before the "calling function" in your definition file
12th Nov 2016, 12:22 AM
Augustin Bar
Augustin Bar - avatar