作者:jusonalie
项目:goinactio
func main() {
Seed(1000)
fmt.Println(int(C.random()))
time.Sleep(time.Duration(1) * time.Second)
fmt.Println(int(C.random()))
fmt.Println("getpid:", int(C.getpid()))
C.puts(C.CString("call C puts"))
Hello("call C's go wrapper func")
C.hello(C.CString("call C hello func"))
}
作者:Fersc
项目:Go-practic
func Seed(semilla int) int {
fmt.Println("Semilla ", semilla)
valor := C.srandom(C.uint(semilla))
tipo := reflect.TypeOf(valor)
fmt.Println("Tipo: ", tipo)
return int(C.random())
}
作者:felixany
项目:g
func Random() int {
var r C.long = C.random()
return int(r)
}
作者:romelgome
项目:notas-sobre-golan
func main() {
fmt.Println("random int front C:", int(C.random()))
}
作者:Bobberin
项目:musing
func Random() int {
return int(C.random())
}
作者:tstatle
项目:continuum-sample-app
func rand() int {
return int(C.random())
}
作者:RobinTe
项目:pant
func main() {
fmt.Printf("Random from C: %d", int(C.random()))
}
作者:kicoo
项目:kicool.g
func main() {
i := C.random()
print(i)
}