Question 21

What will the variable "y" be in class B?
class A {
int x;
protected:
int y;
public:
int age;
};
class B : protected A {
string name;
public:
void Print() {
cout << name << age;
}
};
  • Question 22

    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;
    }
  • Question 23

    What happens when you attempt to compile and run the following code?
    #include <iostream>
    using namespace std;
    class complex{
    double re;
    double im;
    public:
    complex() : re(0),im(0) {}
    complex(double x) { re=x,im=x;};
    complex(double x,double y) { re=x,im=y;}
    void print() { cout << re << " " << im;}
    };
    int main(){
    complex c1;
    c1 = 3.0;
    c1.print();
    return 0;
    }
  • Question 24

    What happens when you attempt to compile and run the following code?
    #include <iostream>
    #include <string>
    using namespace std;
    class First
    {
    string *s;
    public:
    First() { s = new string("Text");}
    ~First() { delete s;}
    void Print(){ cout<<*s;}
    };
    int main()
    {
    First FirstObject;
    FirstObject.Print();
    FirstObject.~First();
    }
  • Question 25

    What happens when you attempt to compile and run the following code?
    #include <iostream>
    using namespace std;
    int main()
    {
    const int x=0;
    const int *ptr;
    ptr = &x;
    cout<<*ptr;
    return 0;
    }
  • Premium Bundle

    Newest CPA Exam PDF Dumps shared by BraindumpsPass.com for Helping Passing CPA Exam! BraindumpsPass.com now offer the updated CPA exam dumps, the BraindumpsPass.com CPA exam questions have been updated and answers have been corrected get the latest BraindumpsPass.com CPA pdf dumps with Exam Engine here:

    (220 Q&As Dumps, 40%OFF Special Discount: Exam-Tests)
    Other Version
    4180C++Institute.CPA.v2024-03-18.q106
    Latest Upload
    167PaloAltoNetworks.SSE-Engineer.v2026-10-17.q44
    290Cisco.300-420.v2026-10-17.q324
    202Salesforce.MCE-Con-201.v2026-10-15.q108
    182EMC.NCA.v2026-10-15.q25
    283Apple.Apple-Device-Support.v2026-10-15.q159
    191F5.F5CAB3.v2026-10-14.q47
    190Oracle.1Z0-1048-25.v2026-10-14.q67
    268Cisco.300-730.v2026-10-14.q199
    259Salesforce.Sales-Admn-202.v2026-10-14.q160
    176ServSafe.ServSafe-Manager.v2026-10-13.q32