logo

Crowdly

#define main1 main /** Klausimas   Ką atspausdins programa? Jeigu programa nes...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

#define main1 main

/** Klausimas  

Ką atspausdins programa? Jeigu programa nesikompiliuoja, rašykite ERROR į atsakymo langelį.

*/

#include <iostream>

#include <iostream>

class A

{

protected:

int _x;

public:

A(int x): _x(x) { std::cout << "A+"; }

~A() { std::cout << "A-"; }

  void rasyk() { std::cout << "R:" << _x;  }

};

class B: public A

{

private:

    int _y;

public:

    B(int x = 43, int y = 41):  A(x), _y(y) { std::cout << "B+"; }

~B() { std::cout << "B-"; }

  void rasyk() { std::cout << "RB:" << _x << _y << "BR"; }

};

int main1()

{

B bs[2];

for(int i=0; i<2;i++)

   bs[ i ].rasyk();

}

More questions like this

Want instant access to all verified answers on emokymai.vu.lt?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!