error: expected unqualified id before '[' token

Can someone figure out what the problem is? It is on line 32.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51

#include <iostream>
#include <vector>
#include <cmath>
#include <math.h>
#include <limits>
using namespace std;
int main()
{
    cout << "h" << endl;

    // insert code here...
    int x;
    int a = 1;
    int b = 2;
    int c = 3;
    int d = 0;
    int total;
    vector<int>v;

    for (;c < 1000; c++)
    {
        double root = sqrt(double(c));

		if(int(root + 0.5) * int(root + 0.5) == c) // is root integer?
            v.push_back(c);
    }
        for (; b < 1000; b++)
        {
            for (int i = 0; i <= v.size(); i++)
            {
                d = v.[i];
           if ((a * a) + (b * b) == d * d)
                {if ( a + b + d == 1000)// checks if the pythagorean triplet adds up to 1k.
                cout << a * b * d; }
            }

            if (b == 998)
                {
                    b = 2;
                    a++;
                }

        }




    return 0;
}
Instead of

d = v.[i];


write

d = v[i];
Thanks so much. Although the program is not producing an answer. This is project euler #9 by the way.
Topic archived. No new replies allowed.