アットウィキロゴ

&bold(){漢字の判定処理}

漢字の判定処理
  • 2バイト文字のうち、1バイト目を見て判断している
  • 漢字である場合(2バイト文字である場合)は1を返し、それ以外は0を返す

int iskanji (char c)
{
   if(((0x81 <= (unsigned char)(c) && (unsigned char)(c) <= 0x9F)
       || (0xE0 <= (unsigned char)(c) && (unsigned char)(c) <= 0xEF))) {
       return 1;
   } else {
       return 0;
   }
}
最終更新:2008年09月13日 17:45
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。