スレを勃てるまでもな ..
[2ch|▼Menu]
376:デフォルトの名無しさん
09/01/02 19:53:32
$ cat c_sizeof.c

#include <stdio.h>

int main(void)
{
printf("sizeof(\'\\x80\') == %d\n", sizeof('\x80'));

return 0;
}

/* EOF */
$ gcc -Wall -std=c99 -o c_sizeof c_sizeof.c
$ ./c_sizeof
sizeof('\x80') == 4
$ cat cxx_sizeof.cxx

#include <iostream>

int main()
{
std::cout << "sizeof(\'\\x80\') == " << sizeof('\x80') << std::endl;

return 0;
}

// EOF
$ g++ -Wall -o cxx_sizeof cxx_sizeof.cxx
$ ./cxx_sizeof
sizeof('\x80') == 1

 なぜ、C言語ではシングルクォートが、4 Bytesであり、C++では、1 Byteなのですか。


次ページ
続きを表示
1を表示
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
暇つぶし2ch

5371日前に更新/192 KB
担当:undef