initial commit
This commit is contained in:
commit
0b3af7375e
39 changed files with 2339 additions and 0 deletions
26
test/test_union.c3
Normal file
26
test/test_union.c3
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
struct CmdA {
|
||||
int a, b;
|
||||
}
|
||||
|
||||
struct CmdB {
|
||||
float a, b;
|
||||
}
|
||||
|
||||
union AnyCmd {
|
||||
CmdA a;
|
||||
CmdB b;
|
||||
}
|
||||
|
||||
struct Cmd {
|
||||
int type;
|
||||
AnyCmd cmd;
|
||||
}
|
||||
|
||||
fn int main()
|
||||
{
|
||||
Cmd c;
|
||||
c.type = 1;
|
||||
c.cmd.a = {.a = 1, .b = 2};
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue