To a first approximation, avoid using raw pointers. They should almost never be needed in application code. Use C++'s standard library facilities for smart pointers and containers instead. They are masterpieces of engineering, and work extremely well.