arrow p posnext pz pos string posstring pos

  • Slides: 3
Download presentation
arrow演算子の補足 p = pos->next;    pに”z番地”が代入される (*pos). string または pos->string pos X番地 ant pos->next->string Y

arrow演算子の補足 p = pos->next;    pに”z番地”が代入される (*pos). string または pos->string pos X番地 ant pos->next->string Y 番地 (*pos). next または pos->next book Z 番地 candy pos->next p W番地 W 番地 dog pos->next->next 1

なぜアドレスも表示しているの? - addr -- next -: string [00430100][00431 dc 0]: HEADER [00431 dc 0][00431

なぜアドレスも表示しているの? - addr -- next -: string [00430100][00431 dc 0]: HEADER [00431 dc 0][00431 e 00]: <crane> [00431 e 00][00431 e 40]: <giraff> [00431 e 40][00430040]: <koala> [00430040][00430080]: <shark> [00430080][004300 c 0]: <hippo> [004300 c 0][0000]: <panda> ------ addr -- next -: string [00430100][00431 e 00]: HEADER [00431 e 00][00431 e 40]: <giraff> [00431 e 40][00431 d 80]: <koala> [00431 d 80][00430080]: <walrus> [00430080][004300 c 0]: <hippo> [004300 c 0][0000]: <panda> ------ nextに次のセルのアドレスが格納さ れているのを確認してほしい 【問題】 < shark >の後ろに<walrus>を挿入して から、 < shark >を削除した。 < shark >を削除する直前はどうなってい たか? -addr -- next -: string [00430100][00431 e 00]: HEADER [00431 e 00][00431 e 40]: <giraff> [00431 e 40][00430040]: <koala> [00430040][00431 d 80]: <shark> [00431 d 80][00430080]: <walrus> [00430080][004300 c 0]: <hippo> [004300 c 0][0000]: <panda> 3