Here is what happens:
ZB(0)
is called but does not runbase constructor
ZA(0)
is called => "ZA (int n)0" andm_i = 1
initializers are processed in the order of fields declaration:
m_x(++m_i)
is evaluated with ++1=2 => "ZA (int n)2" andm_i = 2
m_a(new ZA[2])
is evaluated and create the two ZA instances => "ZA (int n)0" twice
finally the ZB constructor is run => "ZB (int n)2"