Is it possible to put a function in a function? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Is it possible to put a function in a function?

int main() { void printA() { std::cout << 'A'; } printA() }

23rd Apr 2019, 10:22 AM
Anonymous
2 Answers
+ 5
Not possible in C++, but possible in some other languages like Javascript.
23rd Apr 2019, 10:41 AM
Sonic
Sonic - avatar
+ 2
Tried lamdas... didn’t understand... anyway thanks for answering. just needed to know if its possible to do it.
23rd Apr 2019, 12:19 PM
Anonymous