Home > Software engineering >  VB how to declare the union structure?
VB how to declare the union structure?

Time:10-05

Such as topic, how to declare the UNION in vb data structure

CodePudding user response:

Structural prototype
 
Typedef struct {
Int dDev;
Int dPort;
Int dBaud;
Int dbeep;
The union {
Int served1;
Struct {
Int served2;
Byte served2_2 [24].
Byte served2_3 [3076].
};
};
} LtReader, * PLtReader;

CodePudding user response:

For each great god to give directions

CodePudding user response:

First of all is not,
Secondly you this union is really boring, served1 and served2 identical, directly on {int, byte [24], byte [3076]} structure definition of good, to what the union,

CodePudding user response:

reference Tiger_Zhao reply: 3/f
is not first,
Secondly you this union is really boring, served1 and served2 identical, directly on {int, byte [24], byte [3076]} of the structure is defined, to what the union,

This is an interface of others, he the inside of the interface structure is as follows

CodePudding user response:

I mean, when you turn into a VB according to the way of no union, pay attention to the place called served1 and served2 became members of the same,

CodePudding user response:

Parts of the union, respectively defined as two types, to which one to use, define which type, with CopyMemory API directly copied from another type,
  • Related