Out of below 2 typecasting which one is preferred/better to use in a C++ code and why ?
unsigned char var = 10;
unsigned int value;
value = static_cast<unsigned int>(var); //typecasting 1
value = (unsigned int)var; //typecasting 2
Out of below 2 typecasting which one is preferred/better to use in a C++ code and why ?
unsigned char var = 10;
unsigned int value;
value = static_cast<unsigned int>(var); //typecasting 1
value = (unsigned int)var; //typecasting 2