Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
tests
/
c_structs
/
cstruct_test.c.v
17
lines
·
13
sloc
·
244 bytes
·
8e9ddb13eae9cf258284cfde3ad928350d157942
Raw
1
#include
"@VMODROOT/cstruct.h"
2
3
const
the_string =
'the string'
4
5
pub
struct
C.Abc {
6
field int
7
}
8
9
fn
(a &C.Abc) str() string {
10
return
'C.Abc{}'
11
}
12
13
fn
test_cstruct() {
14
x := unsafe { &C.Abc(1) }
15
println(x)
16
assert dump(x.str()) ==
'C.Abc{}'
17
}
18