W
weidongtom
Hi,
I am a novice to C++. Can someone enlighten me as to why I can't get
the following function compile? Thanks
template <class Comparable>
void loop(const vector<Comparable> &array){
for(vector<Comparable>::const_iterator iter = array.begin();
iter != array.end(); ++iter);
}
Compilation Errors:
error: expected `;' before 'iter'
error: 'iter' was not declared in this scope
I am a novice to C++. Can someone enlighten me as to why I can't get
the following function compile? Thanks
template <class Comparable>
void loop(const vector<Comparable> &array){
for(vector<Comparable>::const_iterator iter = array.begin();
iter != array.end(); ++iter);
}
Compilation Errors:
error: expected `;' before 'iter'
error: 'iter' was not declared in this scope