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
Here's a working Go program.
package main
import "fmt"
func conv(x, h []int) []int {
y := make([]int, len(x)+len(h)-1)
for i := 0; i < len(x); i++ {
for j := 0; j < len(h); j++ {
y[i+j] += x[i] * h[j]
}
}
return y
}
func main() {
x := []int{1, 2}
h := []int{7, 8, 9}
y := conv(x, h)
fmt.Println(len(y), y)
}
To avoid wrong guesses, read the Go documentation: The Go Programming Language.