I need some help from an error generated by the compiler.
I hope you can help me.
This is the error message:
FILE.cpp: In function 'int Gamble(std::vector<float, std::allocator<float> >&)':
FILE.cpp::6 :warning: comparison between signed and unsigned integer expressions
FILE.cpp:10: warning: comparison between signed and unsigned integer expressions
And here is the code :
typedef std::vector <std::string> TTokenVector;
int Gamble(std::vector<float>& vec_probs)
{
float range = 0.f;
for (int i = 0; i < vec_probs.size(); i++) //Line 6
}
float fProb = fnumber(0.f, range);
float sum = 0.f;
for (int idx = 0; idx < vec_probs.size(); idx++) //LINE 10
{
sum += vec_probs[idx];
if (sum >= fProb)
return idx;
}
return -1;
}
The default compilator is freebsd ( GCC )