Original Post
I was reading about anonymous unions. Book said, if the anonymous union is global then it has to be static. Why is that?? and Why would I need to use anonymous union anyway??.
Quote:
I get your point but why is anonymous restricted to file scope. That is what I am asking.
Quote:
What if I don't what to have a filescope??
Quote:
If the anonymous union is global then it has to be static. Why is that?
Quote:
Original post by Illco
but isn't anything in global scope inherently static?
Quote:
Original post by Illco
... but isn't anything in global scope inherently static?
Quote:
Original post by LessBread
"The name of each member must be unique within the scope where the union is declared."
Quote:
Original post by TEUTON Quote:
Original post by LessBread
"The name of each member must be unique within the scope where the union is declared."
But isn't that also applicable to the same file.
Quote:
Original post by TEUTON
I guess restriction is to avoid such name clashes across multifile programs.
This topic has been locked by a moderator. New replies are not allowed.
With your permission, GameDev.net uses analytics cookies to understand how people use the platform. You can accept analytics or continue with necessary cookies only. Learn more