• Sign up
  • ‎What is Shvoong?‎
  • Sign In
    Sign In
    Remember my username Forgot your password?

Summaries and Short Reviews

.

Shvoong Home>Science>C to C++ conversion, step by step Summary

.

C to C++ conversion, step by step

Book Abstract by: Positron     

Original Author: R.Sathish
1.Make every file a C++ class
2.All struts and unions become a new class
3.Derive new data hiding classes from
method signatures
A method like add2 complex(double real1,double imag1, double real2, double imag2) must be converted to add2complex(Complex num1, Complex num2).
4.Avoid operator overloading for ease of Java conversion
5.Make init methods constructors, atExit method destructors.
6.Replace malloc by new, and free by delete
7.When every c file becomes a c++ class, categorize fields as public, private and protected.
static fields which are file specific, should be made private or private static
8.Move variable declarations close to their usage
9.Replace macros with inline methods
10.Use template methods for function overloading when arity is same
Like max(int,int), max(float,float) and so on
Published: October 28, 2005

Comments & Reviews about C to C++ conversion, step by step

Please Rate this Review : 1 2 3 4 5

Bookmark & share this post

.