What happens when you attempt to compile and run the following code? #include <iostream> using namespace std; class A { public: virtual void Print(){ cout<<"A";} }; class B:public A { public: void Print(){ cout<< "B";} }; int main() { A *obj; A ob1; obj = &ob1; obj?>Print(); B ob2; obj = &ob2; obj?>Print(); }
Answer(s): A
What happens when you attempt to compile and run the following code? #include <iostream> #include <sstream> #include <string> using namespace std; int main(void) { string s; s = "Test"; s.resize (s.size() ? 1); cout<<s<<" "<<s.size(); return 0; }
Answer(s): D
What happens when you attempt to compile and run the following code? #include <iostream> using namespace std; class A { public: int x; A() { x=0;} }; class B : public A { public: B() { x=1;} }; class C : private B { public: C() { x=2;} }; int main () { C c1; cout << c1.x; return 0; }
What happens when you attempt to compile and run the following code? #include <iostream> #include <string> using namespace std; class A { public: A() { cout << "A no parameters";} A(string s) { cout << "A string parameter";} A(A &a) { cout << "A object A parameter";} }; class B : public A { public: B() { cout << "B no parameters";} B(string s) { cout << "B string parameter";} B(int s) { cout << "B int parameter";} }; int main () { A a2("Test"); B b1(10); B b2(b1); return 0; }
Answer(s): B
Post your Comments and Discuss C++ Institute CPA exam prep with other Community members:
KC Commented on July 10, 2025 While conducting a business process review, the consultant learned that in some instances, customers provide UC with digital pictures of the problem. The average attachment size was 34 MB. Response: On-Demand Email-to-Case works without a local agent, uses your Salesforce address, and supports larger attachments than Web-to-Case. LUXEMBOURG
Chrsito Commented on July 10, 2025 Question 4 has a typo sobelete.txt should be tobelete.txt Anonymous
Christo Commented on July 10, 2025 Great Resource Anonymous
DanTheMan Commented on July 10, 2025 CCNA is Entry Level and im very Happy to have some free dumps, other dumps cost up to 100 bucks. Many Thanks and Best luck to everyone involved and using this dumps GERMANY
Zed Commented on July 10, 2025 using this to prep for my exam UNITED STATES
Our website is free, but we have to fight against bots and content theft. We're sorry for the inconvenience caused by these security measures. You can access the rest of the CPA content, but please register or login to continue.