How can I convert data types from c to go and vice-versa?
For example, I have a function that returns an array of integers:
char* Test()
{
char*msg = "Hello, Go";
return msg;
}
How can I convert it to slice or array?
--UPDATE--
In Go file, I can use C.GoString(C.Test())
to convert the return type to Go String. I'm looking for a complete doc for these functions.
You should have a look at http://golang.org/cmd/cgo/ . Here's an example using it http://golang.org/misc/cgo/gmp/gmp.go