August 2019
Beginner to intermediate
798 pages
17h 2m
English
The simplest way to call C code from a Go program is to include the C code in your Go source file. This needs special treatment but it is pretty fast and not that difficult.
The name of the Go source file that contains both C and Go code is cGo.go and will be presented in three parts.
The first part is next:
package main
//#include <stdio.h>
//void callC() {
// printf("Calling C code!\n");
//}
import "C"
The second part of the program has the next Go code:
import "fmt"
func main() {
So, all the other packages should ...
Read now
Unlock full access