On Tuesday, 21 October 2014 at 12:22:54 UTC, edn wrote:
Could someone provide me with examples showing the usefulness of pointers in the D language? They don't seem to be used as much as in C and C++.

The only difference between C/C++ and D is that C uses pointers for both "pointer to object" and "pointer to array", whereas D has a "slice" object.

C++ introduced "pass-by-ref" (also exists in D), which has tended to reduce the (visible) use.

Furthermore, the more modern the language, the more the "raw" pointers tend to be encapsulated in structures that manage them for you.

So while you don't "see" them quite as much, they are still there, and fill exactly the same role.

Reply via email to