|
From: Alessandro B. <ale...@is...> - 2007-11-12 22:59:09
|
Hello, I wrote this method and I receive an error message in compilation:
bool Dizionario::inDictionary(const string &a) const
{
vector<string>::iterator result =
find( elenco.begin(), elenco.end(), a );
if (result == elenco.end()) return false;
return true;
}
598 C:\Programmi\Dev-Cpp\include\c++\3.3.1\bits\stl_iterator.h invalid
conversion from `const std::string* const' to `std::string*'
I wonder the problem is in elenco.begin() and elenco.end() and the const
method (if I erase the keyword const the program is OK, but I don't want
remove const because the method is const).
Have I cast elenco.begin() and elenco.end()? In which mode?
Thanks
Alessandro
--
************************************************
Prof. Alessandro Bugatti
Docente di Informatica
Istituto Tecnico Industriale Statale B. Castelli
E-mail: ale...@is...
Sito web: www.imparando.net
************************************************
|