#include <iostream>
using namespace std;

class BClass
{
private:
    const char code;	//how to make const?
public:
    BClass(char c) : code(c) {}

    char getCode() const { return code; }
};

class AClass
{
private:
    const BClass b0;	//how to make const?
    const BClass b1;	//how to make const?
    const BClass* bPtrs[2];//how to make const?
public:
    AClass() : b0('x'), b1('y')
    {
        bPtrs[0] = &b0;
        bPtrs[1] = &b1;
    }

    void print(int i) const 
    {
        cout << "char=" << bPtrs[i]->getCode() << endl;
    }
};
AClass a;

int main()
{
    a.print(0); // prints "char=x"
    a.print(1); // prints "char=y"
}