New issue
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
第2章,2.3.3节有一个错误 #547
Comments
零长的数组好像是C99的特性,如果C++不支持可以用 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/*
struct A {
int size: 10; // 位字段无法访问
float arr[]; // 零长的数组也无法访问
};
*/
import "C"
import "fmt"
func main() {
var a C.struct_A
fmt.Println(a.size) // 错误: 位字段无法访问
fmt.Println(a.arr) // 错误: 零长的数组也无法访问
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
int size: 10 无法访问。
int size: 8、16或者32。 可以访问,打印结果:a.size=0。
The text was updated successfully, but these errors were encountered: