c++: when to use pointers?

后端 未结 14 1699
无人共我
无人共我 2020-12-12 22:48

After reading some tutorials I came to the conclusion that one should always use pointers for objects. But I have also seen a few exceptions while reading some QT tutorials

14条回答
  •  既然无缘
    2020-12-12 23:25

    If you don't know when you should use pointers just don't use them.

    It will become apparent when you need to use them, every situation is different. It is not easy to sum up concisely when they should be used. Do not get into the habit of 'always using pointers for objects', that is certainly bad advice.

提交回复
热议问题