[Solved] How to access a member of a pointer to object [closed]


It should definitely initialize readIndex to 0. Just put one print statement and check whether your constructor called properly or not.

Also try with

con::con():readIndex(0)
{
}

3

solved How to access a member of a pointer to object [closed]