constint NEW_WEIGHT = 5;
for (i =0; i < NEW_WEIGHT- 1; i++){
if (NEW_WEIGHT == 4) {
cout << inputWeights.at(i);
}
NEW_WEIGHT can never be 4, as it's declared with a constant value of 5.
I think you mean something like this:
1 2 3 4 5 6 7
for( int i = 0; i < NEW_WEIGHT; i++ ) {
std::cout << inputWeights[i];
// NEW_WEIGHT - 1 is the last element
// if it's not that,
// print a space
if( i != NEW_WEIGHT - 1 ) std::cout << ' ';
}