我正在研究golang,但是有一部分用c語言是不懂的。main中是第二次執行c語言函數,不同的IDE輸出結果不同。為什么會打印出來?package main//#include<stdio.h>//void callC() {// printf("Calling C code!\n");//}import "C"import "fmt"func main() { fmt.Println("A Go statement") C.callC() fmt.Println("Another Go statement")}--在 GoLand 中(模板:go build with Run after build option) --輸出)一個 Go 語句另一個 Go 語句調用 C 代碼!--在終端$ go run hello.go一條 Go 語句調用 C 代碼!另一個 Go 語句
golang中c語言函數執行順序
慕工程0101907
2023-06-01 15:07:05