Gitly
English
Русский
Español
日本語
中文
Português
Pricing
Log in
Register
v4
/
vlib
/
v
/
checker
/
tests
/
function_variadic_arg_array_decompose.vv
12
lines
·
11
sloc
·
142 bytes
·
7a6fd359d08474adeb36925bdcee31daac7d9e28
Raw
1
fn sum(a ...int) int {
2
mut total := 0
3
for x in a {
4
total += x
5
}
6
return total
7
}
8
9
fn main() {
10
b := [5, 6, 7]
11
println(sum(1, 2, ...b))
12
}
13