c ++在unsigned chars的向量中找到char

时间:2011-06-26 16:20:07

标签: c++ vector find char unsigned

我遇到以下代码的问题:

message is vector<unsigned char>

vector<unsigned char>::iterator pos = message.begin();
vector<unsigned char>::iterator start = message.begin();
vector<unsigned char>::iterator end = message.end();

pos = find(start, end, ' ');

我收到了错误:

error: no matching function for call to ‘find(std::vector<unsigned char>::iterator&, std::vector<unsigned char>::iterator&, char)’

1 个答案:

答案 0 :(得分:10)

您是否包括<algorithm>