...
This commit is contained in:
@@ -1,38 +1,13 @@
|
||||
namespace main
|
||||
|
||||
struct Ape {
|
||||
name: string
|
||||
age: i64
|
||||
}
|
||||
|
||||
struct Human {
|
||||
parent: Ape
|
||||
name: string
|
||||
age: i64
|
||||
}
|
||||
|
||||
export func main(args: []^string) {
|
||||
// c::printf("%d\n", args.count)
|
||||
|
||||
// let i: i64
|
||||
|
||||
// while i < args.count {
|
||||
// c::printf("%s\n", args[i])
|
||||
// i = i + 1
|
||||
// }
|
||||
|
||||
let human = alloc Human {
|
||||
parent = alloc Ape {
|
||||
name = "john"
|
||||
age = 24
|
||||
}
|
||||
age = 23
|
||||
name = "oliver"
|
||||
}
|
||||
|
||||
c::printf("%s is %d years old\n", human.name, human.age)
|
||||
c::printf("parent name is %s\n", human.parent.name)
|
||||
|
||||
// human.name = "hubert"
|
||||
// human.age = 92
|
||||
}
|
||||
Reference in New Issue
Block a user