In C++,is it possible to pass functions as argument of another function?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

In C++,is it possible to pass functions as argument of another function??

30th Jul 2019, 6:48 AM
Abhishek V
4 Answers
+ 1
White Devil 😈 You can use function pointer Example void printNum(int num) { cout << num << endl; } void runFunc(void (*func)(int), int num) { func(num); } int main() { runFunc(printNum, 5); return 0; }
30th Jul 2019, 7:03 AM
Agent_I
Agent_I - avatar
+ 1
Yes it's possible
30th Jul 2019, 6:57 AM
Agent_I
Agent_I - avatar
0
can you explain it agent_i
30th Jul 2019, 6:59 AM
Abhishek V
0
Thank you bro 😀😀😀
30th Jul 2019, 7:04 AM
Abhishek V