For some reason, when I define a variable as "uint" instead of "unsigned int" in my program, these are errors. This seems strange because uint typedef'd:
typedef unsigned int uint;
... so I think I could use these two interchangeably. More precisely, I assign the result of a function that returns "unsigned int" to the uint variable, then using this uint in the vector resize call ... at this point, these are errors. Those. my code looks something like this:
unsigned int getUInt() { return 3; } int main(void) { vector<vector<float> > vectVect(100000); for(uint i = 0; i < vectVect.size(); ++i) { vector<float>& myVect = vectVect[i]; uint myUnsignedInt = getUInt(); myVect.resize(myUnsignedInt); } cout << "finished" << endl; }
... and the line in which he is mistaken is the line myVect.resize.
Obviously, I already have a solution, but I would like to understand WHY this is happening, since I am rather puzzled. Does anyone have any idea?
PS - If someone thinks this may matter, I use gcc v4.1.2 for fedora 15 ... and the include file that defines uint is / usr / include / sys / types.h.
Paul molodowitch
source share