OCI - session 3: Tools and best practices for reliable C++ programming
Thibault CHOLEZ -
[email protected] TELECOM Nancy - Universit´ e de Lorraine LORIA - INRIA Nancy Grand-Est From Nicolas Rougier’s C++ crash course
01/03/2017
Error management
Automatic testing
Debugging
Code profiling
Mixed programming
Cross compilation
Plan 1
Error management
2
Automatic testing
3
Debugging
4
Code profiling
5
Mixed programming
6
Cross compilation
OCI - session 3: Tools and best practices for reliable C++ programming 2 / 30
Error management
Automatic testing
Debugging
Code profiling
Mixed programming
Cross compilation
Plan 1
Error management
2
Automatic testing
3
Debugging
4
Code profiling
5
Mixed programming
6
Cross compilation
OCI - session 3: Tools and best practices for reliable C++ programming 3 / 30
Error management
Automatic testing
Debugging
Code profiling
Mixed programming
Cross compilation
Catching an exception Contrary to C ”error codes”, exceptions are transmitted from the callee to the caller until being catched You can catch any exception using the structure bellow If the raised exception is different from the ones you’re catching, program will stop try { float *array = new float[-1]; } catch( std::bad_alloc e ) { std::cerr