The cause of the error
The error message is somewhat cryptic.
Compiling... Errors01.cpp C:\jnk\Errors01.cpp(29) : error C2228: left of '.doSomething' must have class/struct/union type
The cause of the error is the attempt (shown in boldface) to use a dot operator (.) when the pointer-to-member operator (->) must be used instead.
The pointer-to-member operator (->) must be used to access a member of an object stored in dynamic memory by way of a pointer variable containing the address of the object.
(The correct syntax is shown in a comment in the line immediately above the line with the error.)