80 likes | 193 Views
Why convert from C to C++ ?. What do we know?. The sky is blue Snow is cold. What do we know?. The sky is blue Snow is cold This girl is hot AND... C++ supports object-oriented programming. What are the options?. Hide implementation details Reuse class code Reuse generic classes
E N D
What do we know? • The sky is blue • Snow is cold
What do we know? • The sky is blue • Snow is cold • This girl is hot AND... • C++ supports object-oriented programming
What are the options? • Hide implementation details • Reuse class code • Reuse generic classes use a C++ class template and let the compiler do the work • Extend/Overload operators • Derive classes from base classes
What are the options? • Avoid errors through function prototyping • Add parameters without changing function calls • Using safer, simpler I/O • Improve performance with fast inline functions • Overload function names
Some remarks • Change involves effort Changes will be necessary!! • Massage C code into C++ extern “C” {...} • The hard part: designing objects ask what fundamental operations define each object • If it ain’t broke, don’t fix it!