On migrating a VC++ 6.0 developed code to Visual studio 2008, I got this warning in the line below in my code.
const int const CImportContext::PACKETSIZE = 4096;
I know how to fix for pointer
static const int const * PACKETSIZE; // C4114
static const int * const PACKETSIZE; // Correct
But my question is how to fix this warning, if its like the one below(without pointer),
static const int const PACKETSIZE;
Pointers have two different kinds of const
qualifiers makes sense, one is for the pointer itself, the other for what the pointer points.
But it doesn't make sense for int
type to have two different kinds of const
qualifiers. Just use one:
const int CImportContext::PACKETSIZE = 4096;
or
int const CImportContext::PACKETSIZE = 4096;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With