- 415 名前:デフォルトの名無しさん mailto:sage [2010/02/27(土) 19:43:00 ]
- ttp://www.kijineko.co.jp/tech/superstitions/parameter-of-isalpha-is-char.html
ここに書いてあることについてお伺いしたいのですが。 const char str[] = "abc123"; for (char* s = str; *s != '\0'; s++) { if (isalpha(static_cast<unsigned char>(s))) { ... } } こうすべきとのことですが、これは const char str[] = "abc123"; for (char* s = str; *s != '\0'; s++) { if (isalpha(s)) { ... } } の用にキャストを外すと動かないことがあるということでしょうか? "abc123"のように、内容全てがASCII文字であってもだめなのでしょうか? よろしくお願い申し上げます。
|

|