union question

L

Luca

do you know if there is some upper bound on the number of members that
can be contained in a union?
 
G

Gianni Mariani

Luca said:
do you know if there is some upper bound on the number of members that
can be contained in a union?

Why do you ask ?

It's probably implementation dependant.
 
A

Andew Curzon

Apart from the usual retrictions in C++ i.e. no static variables (in
unions), no virtual member functions (in unions), no overloading the =
operator, there is no direct reference in Herb Schildt's manual to any
"upper bound".

Try it yourself and see what happens
Andrew Curzon (UK, C++ Programmer)
 
R

Ron Natalie

Andew Curzon said:
Apart from the usual retrictions in C++ i.e. no static variables (in
unions), no virtual member functions (in unions), no overloading the =
operator, there is no direct reference in Herb Schildt's manual to any
"upper bound".

Fortunately nobody implements a compiler to Schildt's recommendations.
The standard doesn't require that there be either a maximum or minimum
number of union elements supported, but suggests 4096 as the minimum
the implementation su pport.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
474,142
Messages
2,570,818
Members
47,362
Latest member
eitamoro

Latest Threads

Top