1.

Which of the following is true about the following program #include class Test { public: int i; void get(); }; void Test::get() { std::cout <<"Enter the value of i: "; std::cin >>i; } Test t; // Global object int main() { Test t; // local object t.get(); std::cout <<"value of i in local t: "<

A. compiler error: cannot have two objects with same class name
B. compiler error in line "::t.get();"
C. compiles and runs fine
Answer» D.


Discussion

No Comment Found

Related MCQs