In C++ I Cannot Grasp Pointers and Classes

后端 未结 27 1793
隐瞒了意图╮
隐瞒了意图╮ 2020-12-03 02:25

I\'m fresh out of college and have been working in C++ for some time now. I understand all the basics of C++ and use them, but I\'m having a hard time grasping more advance

27条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-03 02:46

    Pointers and classes are completely different topics so I wouldn't really lump them in together like this. Of the two, I would say pointers are more fundamental.

    A good exercise for learning about what pointers are is the following:

    1. create a linked list
    2. iterate through it from start to finish
    3. reverse it so that the head is now the back and the back is now the head

    Do it all on a whiteboard first. If you can do this easily, you should have no more problems understanding what pointers are.

提交回复
热议问题