What is meaning of following declaration?
int(*ptr[5])();
which of the following can be passed in function pointers?
What are the mandatory part to present in function pointers?
What is the output of this program?
1. #include2. using namespace std; 3. int func (int a, int b) 4. { 5. cout << a; 6. cout << b; 7. return 0; 8. } 9. int main(void) 10. { 11. int(*ptr)(char, int); 12. ptr = func; 13. func(2, 3); 14. ptr(2, 3); 15. return 0; 16. }
What is the output of this program?
1. #include2. using namespace std; 3. int n(char, int); 4. int (*p) (char, int) = n; 5. int main() 6. { 7. (*p)('d', 9); 8. p(10, 9); 9. return 0; 10. } 11. int n(char c, int i) 12. { 13. cout << c << i; 14. return 0; 15. }