This is gcc error
No.
or something with c ++ code
Yes. You are using an arrow operator on a pointer that does not point to a valid object. This has undefined behavior.
Highlighting the null pointer and calling method in such a way as not to use any elements is fine.
This is not normal according to the standard. This is UB.
What is a pointer invocation method?
The implementation is specific.
Removing this is nothing special.
Removing this is very special.
You should only take care not to use any item after
Yes, and you must make sure that to create all the instances for which this function is ever called, only new . No automatic objects, no static objects new[] , no malloc + placement of a new one.
So you can delete this , but be careful.
source share