error in counting occurances of a character in a std::string

Can someone please tell me what is wrong with this code:

}while(int((count(code.begin(), code.end(), std::string("\""))))%2 != 0);

I get this error:
c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.4.1\include\c++\bits\stl_algo.h|4412|error: no match for 'operator==' in '__first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with _Iterator = char*, _Container = std::basic_string<char, std::char_traits<char>, std::allocator<char> >]() == __value'|

Thanks
What is the type of the variable "code"?

EDIT: never mind. I know what the type is.

count( code.begin(), code.end(), '"' )

is what you want.
Last edited on
Sorry it was an std::string.
I ended up writing my own function anyway, it only took a couple of minutes and then I didn't need to worry about casting.
Topic archived. No new replies allowed.