What will be the output of the following C++ code? [code] #include <iostream> using namespace std; void func(int x) {

Minh Phượng

New member
What will be the output of the following C++ code?
Code:
    #include <iostream>
    using namespace std;
    void func(int x)
    {
        cout << x ;
    }
    int main()
    {
        void (*n)(int);
        n = &func;
        (*n)( 2 );
        n( 2 );
        return 0;
    }
A. 2
B. 20
C. 21
D. 22
 

Tìm kiếm

Back
Top