C言語のソースコードを読む必要があり読んでいるのですが、後ろにアスタリスクがついていることがあります。
変数の前にしかつかないと思っていたのですが、これはどういった意味なのでしょうか?
allow_hdr = (pjsip_allow_hdr*)
[投稿2022/12/10 12:02時点の投稿内容に対するコメント]
その質問文、本当にそのままのコードですか?本当は
if (!allow_hdr && tdata) {
allow_hdr = (pjsip_allow_hdr*) pjsip_msg_find_hdr(tdata->msg,PJSIP_H_ALLOW, NULL);
}
のように
(pjsip_allow_hdr*) の後ろに続くものがあるのではないですか?
調べていただきありがとうございます!
すみません、改行されていました。。。
pjsip_allow_hdrが型名なので、pjsip_hdr_shallow_cloneの戻り値がpjsip_hdr_shallow_clone型のポインタであるということですね!
```
if (hdr) {
allow_hdr = (pjsip_allow_hdr*)
pjsip_hdr_shallow_clone(tdata->pool, hdr);
pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)allow_hdr);
}
```
回答1件
あなたの回答
tips
プレビュー