Re: [go-nuts] CGO-How to access C struct pointer correctly
On Tue, Aug 7, 2018 at 2:42 PM 陈一剑 wrote: > I want to print 333,but the result is strange. The answer is provided by the compiler itself: jnml@r550:~/src/tmp> cat main.go package main import ( "fmt" /* struct Test{ int ID; }; struct Test * test(){ struct Test test; test
[go-nuts] CGO-How to access C struct pointer correctly
package main import ( "fmt" /* struct Test{ int ID; }; struct Test * test(){ struct Test test; test.ID=333; return &test; }; */ "C" ) type c struct { ID int } type Test struct { a string b string } func