久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

C++中的**是什么?

What is ** in C++?(C++中的**是什么?)
本文介紹了C++中的**是什么?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

我已經看到一些代碼,以及我的編譯器生成的一些錯誤,這些錯誤在變量之前有一個 '**' 標記(例如 **variablename unreferenced-- 或其他東西,我可以不記得完全是偶然的).我相當肯定這與指針有關,如果我不得不猜測它看起來像是試圖取消引用兩次.'**' 是相當無法谷歌的.有人可以給我指出一個好的網站/文檔,還是有人愿意在這里解釋一下?

I've seen some code, as well as some errors generated from my compiler that have a '**' token before the variable (eg **variablename unreferenced-- or something, I can't recall exactly offhand). I'm fairly certain this is related to pointers, if I had to guess it looks like it's trying to dereference twice. '**' is fairly ungoogleable. Can someone point me to a good website/documentation or would someone care to explain it here?

謝謝.

很好的回應.如果我可以添加,在哪些情況下使用指向指針的指針是有用的?難道您不應該只使用原始指針而不是創建另一個指向原始指針的指針嗎?

Great responses. If I can add, what would be some situations where it is useful to have a pointer to a pointer? Shouldn't you just be using the original pointer instead of creating yet another pointer to the original pointer?

推薦答案

** 實際上不僅是指向指針的指針(如在聲明中),而且還是一個解引用的解引用(在一個聲明).

** is not actually only pointer to pointer (as in declaration), but is also the dereference of a dereference (in a statement).

它經常在沒有 & 的 C 中使用.參考符號,例如更新一個指針類型的返回值:

It is used often in C which does not have the & notation for references, e.g. to update a return value which is a pointer type:

int alloc_foo(struct foo **foo_ret)
{
    *foo_ret = malloc(sizeof(struct foo));
    return 1; /* to indicate success; return value in foo_ret */
}

這篇關于C++中的**是什么?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Difference between std::reference_wrapper and simple pointer?(std::reference_wrapper 和簡單指針的區別?)
Difference between const. pointer and reference?(常量之間的區別.指針和引用?)
How to access the contents of a vector from a pointer to the vector in C++?(c++ - 如何從指向向量的指針訪問向量的內容?)
Meaning of *amp; and **amp; in C++(*amp; 的含義和**amp;在 C++ 中)
Why can#39;t I do polymorphism with normal variables?(為什么我不能對普通變量進行多態?)
Dereferencing deleted pointers always result in an Access Violation?(取消引用已刪除的指針總是會導致訪問沖突?)
主站蜘蛛池模板: 欧美成人一区二区三区 | 国产精品日日摸夜夜添夜夜av | 国产视频精品在线 | 久久亚洲国产 | 欧美精品一区二区三区四区 在线 | 国产精品久久久久久久久久久免费看 | 国产美女在线观看 | 玩丰满女领导对白露脸hd | 日本一区二区高清不卡 | 国产精品久久777777 | 国产视频一视频二 | 国产精品视频二区三区 | 欧美一级黄色片在线观看 | 欧美一区二区在线播放 | 国产一区二区自拍 | av网站在线看 | 日本三级全黄三级三级三级口周 | 日韩免费高清视频 | 狠狠婷婷综合久久久久久妖精 | 亚洲国产精品日韩av不卡在线 | 亚洲精品www. | 国产在线播 | 天天看天天操 | 亚洲精品久久 | 一级黄色片一级黄色片 | 99re在线 | 欧美在线国产精品 | 在线观看第一区 | 国产一区二区三区视频 | 亚洲精品一区二三区不卡 | 色综合av | 精品少妇一区二区三区日产乱码 | 新超碰97 | 日韩免费 | 在线小视频 | 日韩欧美成人一区二区三区 | 毛片综合 | 一区视频| 亚洲天堂中文字幕 | 亚洲一区国产精品 | 91精品国产综合久久婷婷香蕉 |