August 2017
Intermediate to advanced
438 pages
14h 19m
English
You might remember situations where you were writing the following code:
void some_function(unsigned short param); int foo(); void do_something() { // Some compilers may warn, that int is being converted to // unsigned short and that there is a possibility of loosing // data. some_function(foo());}
Usually, programmers just ignore such warnings by implicitly casting to the unsigned short datatype, as demonstrated in the following code snippet:
// Warning suppressed.some_function( static_cast<unsigned short>(foo()) );
But, what if foo() returns numbers that do not fit into unsigned short? This leads to hard detectable errors. Such errors may exist in code for years before they get caught and fixed. Take a ...
Read now
Unlock full access