作者butterflyred (butterflyred)
看板C_and_CPP
標題請問namespace前的雙冒號
時間Fri May 22 15:48:22 2020
1. ::std::out
2. std::out
如上請問兩者差在哪?
不太確定namespace前的雙冒號代表什麼意思?
麻煩大家了
謝謝
----
Sent from
BePTT on my OPPO CPH1920
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.116.164.247 (臺灣)
※ 文章網址: https://webptt.com/m.aspx?n=bbs/C_and_CPP/M.1590133704.A.A40.html
1F:→ Lipraxde: :: = scope resolution operator 05/22 15:56
2F:→ qscgy4: 分類勒???? 05/22 15:59
3F:→ qscgy4: google 一下不就有答案了嗎? 05/22 16:03
4F:推 steve1012: fully qualification 05/22 16:16
5F:→ steve1012: fully qualify. 比如說你的nespace A 裡面有B. B 會被 05/22 16:17
6F:→ steve1012: 當成是A::B 05/22 16:17
7F:→ steve1012: 要是你想要外面的B 你就需要寫 ::B 05/22 16:18
8F:噓 newking761: google很難? 05/22 21:22
9F:→ eye5002003: global namespace scope,就是個完全沒有省略的全名 05/23 13:30
11F:→ joe820730: stackoverflow的問答,參考看看 05/23 14:17