Nowadays I would say pointers are more useful in C than in C++.
>> In C, pointers can be used for performance, to prevent copying of large amounts of data.
<< In C++, there are references for this purpose.
>> In C pointers to functions can help improve the code.
<< In C++ this functionality is of dubious benefit. C++11 also adds std::function
and lambda functions.
>> In C, pointers are used as dynamic arrays.
<< In C++, using dumb pointers for dynamic memory allocation is generally a bad idea (C++ exceptions are one reason why). For such purposes, C++ offers smart pointers such as std::unique_ptr
and containers such as std::vector
<< The other use of pointers in C++ is, as kbw mentioned, polymorphism.
Still, you could and should use smart pointers for this as well.
Edit: "Nowadays I would say pointers are more useful in C than in C++."
I mean that in the sense that modern C++ offers many facilities as an alternative to dumb pointers. One will still find a good use for dumb pointers in "serious" coding, when in pursuit of efficiency and performance.