How do pointer to pointers work in C?

前端 未结 14 1249
渐次进展
渐次进展 2020-11-22 02:03

How do pointers to pointers work in C? When would you use them?

相关标签:
14条回答
  • 2020-11-22 03:08

    When covering pointers on a programming course at university, we were given two hints as to how to begin learning about them. The first was to view Pointer Fun With Binky. The second was to think about the Haddocks' Eyes passage from Lewis Carroll's Through the Looking-Glass

    “You are sad,” the Knight said in an anxious tone: “Let me sing you a song to comfort you.”

    “Is it very long?” Alice asked, for she had heard a good deal of poetry that day.

    “It's long,” said the Knight, “but it's very, very beautiful. Everybody that hears me sing it - either it brings the tears to their eyes, or else -”

    “Or else what?” said Alice, for the Knight had made a sudden pause.

    “Or else it doesn't, you know. The name of the song is called ‘Haddocks' Eyes.’”

    “Oh, that's the name of the song, is it?" Alice said, trying to feel interested.

    “No, you don't understand,” the Knight said, looking a little vexed. “That's what the name is called. The name really is ‘The Aged Aged Man.’”

    “Then I ought to have said ‘That's what the song is called’?” Alice corrected herself.

    “No, you oughtn't: that's quite another thing! The song is called ‘Ways And Means’: but that's only what it's called, you know!”

    “Well, what is the song, then?” said Alice, who was by this time completely bewildered.

    “I was coming to that,” the Knight said. “The song really is ‘A-sitting On A Gate’: and the tune's my own invention.”

    0 讨论(0)
  • 2020-11-22 03:08

    I've created a 5 minute video that explains how pointers work:

    https://www.youtube.com/watch?v=3X-ray3tDjQ

    0 讨论(0)
提交回复
热议问题