#include <iostream>
#include <vector>
#include <string>
using std::string;
using std::cout; using std::cin; using std::endl;
using std::vector;
int main()
{
int number;
vector<int> v1;
while ( cin >> number )
{
v1.push_back(number);
}
for ( vector<int>::size_type i = 0; i < v1.size() ; ++i )
{
if ( (i+1) <= (v1.size() - 1) )
cout << (v1.[i] + v1.[i+1]) << " ";
}
return 0;
}
However, I'm getting a "Expected Unqualified-id" error at the
cout << (v1.[i] + v1.[i+1]) << " "; line.