Rivoreo Source Code Repositories
src.rivoreo.one
/
compiler-explorer
/
3ddcb80a7e7e08bd70b429044e2d99e5fa31b590
/
.
/
examples
/
zig
/
Sum_over_array.zig
blob: f17e547d2d5d19b1783af84da19cf9e4ab0676ef [
file
] [
log
] [
blame
] [
raw
]
export
fn sumArray
(
array
:
[*]
const
u32
,
len
:
usize
)
u32
{
var
sum
:
u32
=
0
;
for
(
array
[
0.
.
len
])
|
item
|
{
sum
+=
item
;
}
return
sum
;
}