【初心者歓迎】C/C++室 Ver.41【環境依存OK】
at TECH
[
2ch
|
▼Menu
]
■コピペモード
□
スレを通常表示
□
オプションモード
□このスレッドのURL
■項目テキスト
500:デフォルトの名無しさん 07/08/20 21:09:14 例えば、"a"とか"あ"の文字コードを出力する方法ってありますか? 501:デフォルトの名無しさん 07/08/20 21:11:15 printf( "%d", 'a' ); 502:デフォルトの名無しさん 07/08/20 21:30:04 >>501 ありがとうございます。 このページ http://ash.jp/code/unitbl21.htm の、UTF-8の欄のような値を出力する方法ってありますか? 503:デフォルトの名無しさん 07/08/20 22:23:30 %Xでの表示をぐるぐるまわせばおわりだろうに。 504:デフォルトの名無しさん 07/08/20 22:26:44 >495 http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#456 によると、 > Including the header <cxxx> declares a C name in namespace std. > Including the header <xxx.h> declares a C name in namespace std (effectively by including > <cxxx>), then imports it into the global namespace with an individual using declaration. ということで、xxx.h だと std とグローバル両方で宣言されるというのが規格の意図らしい。 なので、BCB2006 の挙動は(それだけ見ると)規格に合致している。 が、現実的には > If you want to assuredly declare a C name in the global namespace, include <xxx.h>. > You may or may not also get the declaration in namespace std. > If you want to assuredly declare a C name in namespace std, include <cxxx>. > You may or may not also get the declaration in the global namespace. ということで、>495 が妥当な仮定。 規格もこの現状を追認する形での修正が提案されている。 >502 自分がやりたいと思っていることをもうちょい正確に表現して欲しい。 文字が表示されて欲しいのか、文字コードが表示されて欲しいのかどっち? 入力として考えているのはどんなデータ?外部から与えられる文字列か、文字列リテラルか。文字コードは?
次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
レスジャンプ
mixiチェック!
Twitterに投稿
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch
5015日前に更新/231 KB
担当:undef