Pass vector to a function
I'm reading how to use STL in C++. And I have read one code:
Code:
void functionX(vector<int>&a){
......
//some line of code
}
int main(){
vector<int> b(10);
functionX(b);
int c[10];
functionX(c); //error
return(0);
}
the above code mean functionX will use vector<a> to doing something (and it will not copy another vector-->efficiently purpose) But if I use for array c will meet error. So, my question is: the declare of functionX is especially design just for "vector"?
thanks :)