Click here to Skip to main content
16,011,849 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: My first Win32 program... Pin
Hamid_RT3-Jun-08 4:01
Hamid_RT3-Jun-08 4:01 
AnswerRe: My first Win32 program... Pin
sudhir_Kumar3-Jun-08 4:11
sudhir_Kumar3-Jun-08 4:11 
AnswerRe: My first Win32 program... Pin
toxcct3-Jun-08 5:02
toxcct3-Jun-08 5:02 
QuestionDifference b/w Unions and Structures... Pin
xelios3-Jun-08 3:12
xelios3-Jun-08 3:12 
AnswerRe: Difference b/w Unions and Structures... Pin
CPallini3-Jun-08 3:20
mveCPallini3-Jun-08 3:20 
AnswerRe: Difference b/w Unions and Structures... Pin
Alan Balkany3-Jun-08 3:20
Alan Balkany3-Jun-08 3:20 
GeneralRe: Difference b/w Unions and Structures... Pin
DQNOK3-Jun-08 9:28
professionalDQNOK3-Jun-08 9:28 
AnswerRe: Difference b/w Unions and Structures... Pin
toxcct3-Jun-08 3:22
toxcct3-Jun-08 3:22 
question before answering : did you bother searching the web/docs/msdn/google/whatever before asking that dumb question asked and answered tons of times ?

the difference between unions and structures (and classes if in C++) is that all the members of the union share the same memory address. in other words, it means that they all start at the same address, and them, it also means that the size of the union equals the size of its largest member.

so, the other question which usually comes after such an answer is : "but what can it be used for, then ?".
good question Sherlock.
in fact, it's not used much in everyday programming, especially in management applications.
I used to use it when I was coding for hardware, when some component had to share the same physical address. so to represent such a material in the software, a union was exactly what was needed.


AnswerRe: Difference b/w Unions and Structures... Pin
Hamid_RT3-Jun-08 3:32
Hamid_RT3-Jun-08 3:32 
General[Message Deleted] Pin
toxcct3-Jun-08 3:33
toxcct3-Jun-08 3:33 
GeneralRe: Difference b/w Unions and Structures... Pin
Hamid_RT3-Jun-08 4:00
Hamid_RT3-Jun-08 4:00 
AnswerRe: Difference b/w Unions and Structures... Pin
sudhir_Kumar3-Jun-08 3:59
sudhir_Kumar3-Jun-08 3:59 
Questionwhere can i get some unix filesystem emulator? Pin
sunerbun3-Jun-08 2:25
sunerbun3-Jun-08 2:25 
QuestionRe: where can i get some unix filesystem emulator? Pin
CPallini3-Jun-08 2:49
mveCPallini3-Jun-08 2:49 
AnswerRe: where can i get some unix filesystem emulator? Pin
toxcct3-Jun-08 2:55
toxcct3-Jun-08 2:55 
GeneralRe: where can i get some unix filesystem emulator? Pin
Hamid_RT3-Jun-08 3:10
Hamid_RT3-Jun-08 3:10 
GeneralRe: where can i get some unix filesystem emulator? Pin
toxcct3-Jun-08 3:12
toxcct3-Jun-08 3:12 
AnswerRe: where can i get some unix filesystem emulator? Pin
Rajkumar R3-Jun-08 3:11
Rajkumar R3-Jun-08 3:11 
QuestionIf one application is running second doesn't show up Pin
VCProgrammer3-Jun-08 1:57
VCProgrammer3-Jun-08 1:57 
AnswerRe: If one application is running second doesn't show up Pin
toxcct3-Jun-08 2:00
toxcct3-Jun-08 2:00 
GeneralRe: If one application is running second doesn't show up Pin
VCProgrammer3-Jun-08 2:21
VCProgrammer3-Jun-08 2:21 
GeneralRe: If one application is running second doesn't show up Pin
toxcct3-Jun-08 2:22
toxcct3-Jun-08 2:22 
AnswerRe: If one application is running second doesn't show up Pin
Hamid_RT3-Jun-08 2:00
Hamid_RT3-Jun-08 2:00 
AnswerRe: If one application is running second doesn't show up Pin
Cedric Moonen3-Jun-08 2:01
Cedric Moonen3-Jun-08 2:01 
AnswerRe: If one application is running second doesn't show up Pin
sudhir_Kumar3-Jun-08 2:08
sudhir_Kumar3-Jun-08 2:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.