Is there any difference in unions from structures - except than memory allocation ?
Is there any difference in unions from structures - except than memory allocation ?
No.
Did you have something specific in mind?
Its just that they appeared like twins to me.
Thank you.
No. Only difference between union and structure is the way they get stored in memory.
I can't recall the behaviour of objects with constructors etc in a union, but basically don't do it anyway.
Not sure if you can inherit from them either.
I am sure that you cannot inherit from structs and unions ;)Quote:
Not sure if you can inherit from them either.