anyone got any tips to understand functions? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

anyone got any tips to understand functions?

im still confused to relate the function prototype, function call & function definition.

14th Jun 2016, 7:08 AM
Jayy
Jayy - avatar
3 Answers
+ 6
You can simple to understand the function. for example: Function is like a pen. Pen used to write something, this is the perpouse of the pen. Any time you want to write then you use your pen( likewise any time you want the same function's function then you call it.) You need not every time buy a new pen(Here,every time you need not create separate function, use the only one function when you want the same action) USAGE : * function is save the time to write a programme. * And save the memmory(storage). ( Sorry, for my english writting mistakes…)
15th Jun 2016, 6:27 AM
Prasanna Udpm
Prasanna Udpm - avatar
+ 1
You can understand it in a way that a function contains a code which is compressed in the main. As soon as the the compiler encounters a function (called in the main) it starts to find where it is defined (i.e. where the function definition is) and opens the code there and starts executing the code defined in the function. After the code ends... it jumps back to the line after the function call and starts it execution from there.
14th Jun 2016, 7:42 AM
Satan 666
Satan 666 - avatar
0
Doing dibuge the code you know what function help in programme
21st Jul 2016, 3:13 PM
harshvardhan