What is the output of the program?

What is the output of the program?
#include #include using namespace std;
union t
{
char c; int i;
};
class First
{
union t u; public: First() {
u.c = ‘A’;
}
void Print(){ cout << u.c; } }; int main() { First *t = new First(); t?>Print();
}
A. Garbage value
B. It prints: A
C. It prints: A 65
D. Compilation error

Download Printable PDF. VALID exam to help you PASS.

Posted in: CPA

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.