Update hw5 to a newer version.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
b24a264f7e
commit
9224001a22
262 changed files with 2575 additions and 1442 deletions
18
hw5/hw5programs/tc_struct_null_field.oat
Normal file
18
hw5/hw5programs/tc_struct_null_field.oat
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
struct A {
|
||||
int x
|
||||
}
|
||||
|
||||
struct B {
|
||||
A? a /* can be null */
|
||||
}
|
||||
|
||||
int program(int argc, string[] args) {
|
||||
var b = new B{a=A null};
|
||||
b.a = new A{x = 3};
|
||||
if? (A a2 = b.a) {
|
||||
return a2.x;
|
||||
}
|
||||
b.a = A null;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue