One thing that always annoyed me about C and C++ is that sometimes you are forced to mix unsigned and signed types. For instance when you pass an array to a function and to be correct you better pass a size_t as the size too.
Then if you loop through the array with an int you get the warning that you're mixing unsigned and signed types but if you change it to size_t and the SetVal expects an int then you get the warning there.Code:void func(OBJ results[3], size_t n) { for (int i = 0; i < n; i++) { if (results[i] != 0) results[i].SetVal(i); } } }
How do you guys solve this?



LinkBack URL
About LinkBacks



