We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ch2.7.2 C临时访问传入的Go内存 P111的示例没有打印输出
The text was updated successfully, but these errors were encountered:
修改为如下代码就可以正常输出了, 难道是线程退出时没有刷新缓冲区?????? package main
/* void printString(const char* s) { printf("%s", s); printf("\n"); } */ import "C" func printString(s string) { cs := C.CString(s) defer C.free(unsafe.Pointer(cs)) C.printString(cs) } func main() { s := "hello" printString(s) }
Sorry, something went wrong.
可以手工调用 fflush( stdout );试试
fflush( stdout );
chai2010
No branches or pull requests
ch2.7.2 C临时访问传入的Go内存 P111的示例没有打印输出
The text was updated successfully, but these errors were encountered: