You should change the array definition to this:
int a[3];
...and the allocation to this:
a[0] = 1
a[1] = 2
a[2] = 3
If you require dynamically sized arrays you should read into dynamic memory allocation with C++.
Regards,
Adam
Edit: or use a std::vector