-
-
Notifications
You must be signed in to change notification settings - Fork 9
va_start
IsaacShelton edited this page Mar 21, 2022
·
1 revision
va_start
is used to initialize a va_list
va_start my_va_list
or
va_start(my_va_list)
import basics
func main {
print(addEmUp(4, 10si, 11si, 12si, 13si))
}
func addEmUp(count usize, ...) int {
ap, ap2 va_list
sum int
va_start ap
defer va_end ap
va_copy(ap2, ap)
repeat count {
sum += va_arg(ap, int)
sum += va_arg(ap2, int)
}
return sum
}