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

Lê Như Ý

New member
What will be the output of the following C++ code?
Code:
    #include <iostream>
    using namespace std;
    int main()
    {
        int n = 5;
        void *p = &n;
        int *pi = static_cast<int*>(p);
        cout << *pi << endl;
        return 0;
    }
A. 5
B. 6
C. compile time error
D. runtime error
 

Tìm kiếm

Back
Top