C++相談室 part154
at TECH
[
2ch
|
▼Menu
]
■コピペモード
□
スレを通常表示
□
オプションモード
□このスレッドのURL
■項目テキスト
350:デフォルトの名無しさん 21/01/31 12:10:02.04 gXTMTlGe.net >>343 それです。 ありがとうございます。 351:デフォルトの名無しさん 21/01/31 13:12:26.22 ZnRwde8F.net >>341 英語サイトでも、説明の仕方が誤解を招くようなものがありまして、もしかしたらそれは誤解かも知れません。 https://stackoverflow.com/questions/25090635/use-and-in-c-programs 「Here's wh 352:at the C standard says (section 7.1.3): 1. All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use. 2. All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces.」 訳: 1. アンダースコアで始まって直後に英大文字が続くか、または、アンダースコアが連続して 続く識別子は、いかなる使用も予約されている。 2. アンダースコアで始まる全ての識別子は、通常または、タグ名前空間における ファイルスコープの識別子として常に予約されている。 1. の方は、_XXX か、__xxx は予約されていると言うことですが、 2. の方は、_xxx の形式は、例え xxx の部分の先頭が小文字であっても、ファイルスコープにおける 識別子として予約されており、ローカル変数名としては使うべきではないということだと思われます。 また、C++の方では、 https://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier *Reserved in any scope, including for use as implementation macros: 10. identifiers beginning with an underscore followed immediately by an uppercase letter 11. identifiers containing adjacent underscores (or "double underscore") *Reserved in the global namespace: 12. identifiers beginning with an underscore この12.の書き方が(あなたに)誤解を招いた気がします。 また、11.によれば、xxx__yyy のように _ が連続するものは、識別子の中間であっても予約されている とのことです。
次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
レスジャンプ
mixiチェック!
Twitterに投稿
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch
287日前に更新/256 KB
担当:undef