If I am using an int as the array size when declaring a new array lint complains. What is the correct way to resolve this:
I could statically cast int to unsigned but that looks a bit odd...
What is the best way to resolve this without changing the use of an array and the need for integer as size?
MapItemPtr* pMapItems = new MapItemPtr[ (unsigned int)iRecordCount ];
Could do:
MapItemPtr* pMapItems = new MapItemPtr[static_cast<unsigned int>( iRecordCount )];
Is this the correct way to resolve the lint error: Line 3811 Error 737: Loss of sign in promotion from int to unsigned int
or is there a more elegant way?