A union is an object similar to a structure except that all of its members start at the same location in memory . A union variable can represent the value of only one of its members at a time. In C++, structures and unions are the same as classes except that their members and inheritance are public by default.