codecamp

isascii

 原型:extern int isascii(int c);
 
 用法:#include <ctype.h>
 
 功能:判断字符c是否为ascii码
 
 说明:当c为ascii码时,返回非零值,否则返回零。ascii码指0x00-0x7F之间的字符
 
 举例:


     // isascii.c
     
     #include <syslib.h>
     #include <ctype.h>
     main()
     {
       char s[]="文曲星-BJGGV";
       int i=12;            // length of string s
       
       clrscr();            // clear screen
       textmode(0xE0);      // make sure LCD mode is 3 big line
       printf("%s\n",s);
       for(i=0;i<12;i++)
       {
         if(isascii(s[i])) putchar('^');
         else putchar('.');
       }
       getchar();
       return 0;
     }


isalpha
isblank
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

alloi动态内存

stdio输入输出函数

stdlib基础库函数

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }