"Subscript requires array or pointer type."

This is a discussion on "Subscript requires array or pointer type." within the C++ Programming forums, part of the General Programming Boards category; Hey, all,
Very new to C++ programming. I'm attempting to code a function that takes the inner product of two ...

"Subscript requires array or pointer type."

Hey, all,

Very new to C++ programming. I'm attempting to code a function that takes the inner product of two vectors and it's giving me the error message: subscript requires array or pointer type. Here is my code:

I suggest you get to learn std::array or std::vector lest you make buffer overruns or corrupt data. Also declare variables near first use. You can declare them in the initialization part of the for loop too!
Some material to help you: SourceForge.net: Safer arrays in Cpp - cpwiki