I assume that defining the structure is part of some third-party functions / libraries where the third party may be someone inside your own company.
If the developers decided not to make the stData pointer, then there are reasons. They will have an idea of how to express " stData empty", even if allowed to be empty. You should definitely try to find these semantics in the documentation or talk to them. Do not try to add your own semantics to a structure that has a specific purpose and semantics.
So, if there is a predefined way to express that part of the structure is empty, use this path. If it cannot be empty for the purpose for which it is intended, then do not try to make it empty. In short, do not use the class / structure so that it is not used. Instead, if you find yourself in a situation where you only have some of the data needed for "MyData" to make sense, then write your own structure "MyPartialData" to handle this situation and translate it into "MyData" as only you have everything you need and are ready to interact with a third-party API.
Arne mertz
source share