Limitations on the Use of Strings in Unions
|Top Previous Next|
In Tibbo C, unions cannot include string members or member structures, whose members include strings:
The reason for this limitation is that string variables include metadata (current length and capacity), which could potentially become invalid as a result of union manipulation (for example, it would be possible to set current length > capacity).
Related compiler error looks like this:
"POD" stands for "plain old data". Strings contain metadata, so they are not "plain old data".