Files
llgo/compiler/cl/_testrt/callback/in.go

19 lines
244 B
Go
Raw Normal View History

package main
import (
"github.com/goplus/llgo/c"
)
2024-05-05 19:44:16 +08:00
func callback(msg *c.Char, f func(*c.Char)) {
f(msg)
}
func print(msg *c.Char) {
c.Printf(msg)
}
func main() {
2024-05-05 19:44:16 +08:00
callback(c.Str("Hello\n"), print)
callback(c.Str("callback\n"), print)
}