Eliminating the error "expression must have a pointer to the class type"
1 answer
operator->
has a higher precedence than operator*
, therefore *m->B
equivalent to *(m->B)
; and m->B
is invalid here.
You must change it to (*m)->B
.
+8
source to share