v2 / vlib / v / tests / project_with_c_code_2 / main.v
14 lines · 12 sloc · 251 bytes · 4a10514081939b08917684d06df3c47e3f359fc1
Raw
1module main
2
3import v.tests.project_with_c_code_2.modc
4
5// passing array of Vtype to C
6// Vtype wraps a C type
7fn main() {
8 a := [1, 2, 3, 4]
9 mut vals := []modc.Vtype{}
10 for v in a {
11 vals << modc.new_vtype(v)
12 }
13 modc.call_with_array_param(vals)
14}
15