To write better C++ code try to use following tips
- Use smart Pointers instead raw pointers
- Use smart Objects instead normal objects
- Thread controlling variables
- File handlers
- Database connection
- Pointers
- Keep only required function public, rest all functions are to be kept private
- received arguments const if you are not modifying it
- Use Rule of 3 or 5. Do create copy and move versions of constructor and assignment along with destructor
- Use Design Patterns