Hi, a curious question. Why is the value of an int % a size_t strange?
They should be the same.. right?Code:#include <iostream> #include <math.h> #include <vector> using namespace std; int main(){ vector<int> somevec; somevec.push_back(0); somevec.push_back(0); somevec.push_back(0); somevec.push_back(0); somevec.push_back(0); somevec.push_back(0); int moo = -1 % 6; int boo = -1 % somevec.size(); int zoo = -1 % (int)(somevec.size()); cout << "mm : " << moo << endl; cout << "m2 : " << boo << endl; cout << "m3 : " << zoo << endl; }
Cheers