CS153/hw5/hw5programs/tc_correct_struct_fptr.oat

13 lines
203 B
Text
Raw Normal View History

struct S {
int s;
int t;
(int, int) -> int f
}
int add(int x, int y) { return x + y; }
int program(int argc, string[] argv) {
var x = new S { s = 3; t = 4; f = add };
return x.f(x.s, x.t);
}