Maroun85 answer is correct. This is not obvious but a in int size(int a[]) is a pointer.
But why don't you do it the c++ way. Using std::vectors
std::vector a = {5,2,4,7,1,8,9,10,6};
cout << a.size() << endl;
no tricks here
-- edit
If your compiler does not support c++11. You can do:
std::vector a;
a.push(5);
a.push(2);
...
cout << a.size() << endl;