Array multiplication in C++