I\'m having a little play with google\'s Go language, and I\'ve run into something which is fairly basic in C but doesn\'t seem to be covered in the documentation I\'ve seen
The length is part of the array's type, you can get length of an array by the len() built-in function. So you needn't pass the xlen, hlen arguments.
In Go, you can almost always use slice when passing array to a function. In this case, you don't need pointers. Actually, you need not pass the y argument. It's the C's way to output array.
In Go style:
func conv(x, h []int) []int {
y := make([]int, len(x)+len(h))
for i, v := range x {
for j, u := range h {
y[i+j] = v * u
}
}
return y
}
Call the function:
conv(x[0:], h[0:])