No function can be declared within the body of the another function...... True or false | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

No function can be declared within the body of the another function...... True or false

9th Aug 2020, 5:05 PM
Yogita Dose
Yogita Dose - avatar
2 Answers
+ 3
Yogita Dose False Functions can be declared inside other functions.Only definitions are not allowed E.g Try running the following code and see for yourself #include <stdio.h> int main() { void g(int a); g(1); return 0; } void g(int a) { printf("hello world"); }
9th Aug 2020, 7:31 PM
Anthony Maina
Anthony Maina - avatar
+ 1
If you want you can try c++ lambdas
10th Aug 2020, 5:20 PM
Ockert van Schalkwyk
Ockert van Schalkwyk - avatar