Exemple #1
0
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"))
}
Exemple #2
0
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())
}
Exemple #3
0
func Random() int {
	var r C.long = C.random()
	return int(r)
}
func main() {
	fmt.Println("random int front C:", int(C.random()))
}
Exemple #5
0
func Random() int {
	return int(C.random())
}
func rand() int {
	return int(C.random())
}
Exemple #7
0
func main() {
	fmt.Printf("Random from C: %d", int(C.random()))
}
Exemple #8
0
func main() {
	i := C.random()
	print(i)
}