unions are used whenever the same data can be represented in two or more ways, or by two or more data types. Normally I think unions are place inside structures, something like a
VARIANT structure. This structure has two members, an integer that tells which of the union members are used, and then the union of 20 or so data types.
>>.Also why are unions specifically used in mouse programming
AFAIK unions are not used for that purpose because the program needs to know both the x and y coordinates of the mouse. A union would not provide that information.
Last edited by Ancient Dragon; Oct 6th, 2009 at 2:16 am.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,953 posts
since Aug 2005