課程
/后端開(kāi)發(fā)
/C
/C語(yǔ)言入門(mén)
#include<ctype.h>
2016-09-26
源自:C語(yǔ)言入門(mén) 2-4
正在回答
聲明該程序包含ctyp.h這個(gè)函數(shù)集文件
? 1 字符測(cè)試函數(shù)? 1> 函數(shù)原型均為int isxxxx(int)? 2> 參數(shù)為int, 任何實(shí)參均被提升成整型? 3> 只能正確處理處于[0, 127]之間的值? 2 字符映射函數(shù)? 1> 函數(shù)原型為int toxxxx(int)? 2> 對(duì)參數(shù)進(jìn)行檢測(cè), 若符合范圍則轉(zhuǎn)換, 否則不變? int tolower(int); 'A'~'Z' ==> 'a'~'z'? int toupper(int); 'a'~'z' ==> 'A'~'Z'? @函數(shù)名稱: isalpha? 函數(shù)原型: int isalpha(int ch);? 函數(shù)功能: 檢查ch是否是字母.? 函數(shù)返回: 1是字母返回 ,否則返回 0.? 參數(shù)說(shuō)明:? 所屬文件 ? #include ? #include ? int main()? {? char ch1='*';? char ch2='a';? if(isalnum(ch1)!=0)? printf("%c is the ASCII number or alphebet\n",ch1);? else? printf("%c is not the ASCII number nor alphebet\n",ch1);? if(isalnum(ch2)!=0)? printf("%c is the ASCII number or alphebet\n",ch2);? else? printf("%c is not the ASCII number nor alphebet\n",ch2);? return 0;? }? @函數(shù)名稱: iscntrl? 函數(shù)原型: int iscntrl(int ch);? 函數(shù)功能: 檢查ch是否控制字符(其ASCII碼在0和0x1F之間,數(shù)值為 0-31).? 函數(shù)返回: 是返回 1,否則返回 0.? 參數(shù)說(shuō)明:? 所屬文件: ? #include ? #include ? char chars[]={'A',0x09,'Z'};? #define SIZE sizeof(chars)/sizeof(char)? int main()? {? int i;? for(i=0;i
舉報(bào)
C語(yǔ)言入門(mén)視頻教程,帶你進(jìn)入編程世界的必修課-C語(yǔ)言
1 回答#include是什么意思
5 回答include 是什么意思
4 回答#include<stdio.h>什么意思
4 回答#include <string.h> 什么意思
2 回答#include <windows.h> 是什么意思?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-09-26
聲明該程序包含ctyp.h這個(gè)函數(shù)集文件
2016-09-26
? 1 字符測(cè)試函數(shù)
? 1> 函數(shù)原型均為int isxxxx(int)
? 2> 參數(shù)為int, 任何實(shí)參均被提升成整型
? 3> 只能正確處理處于[0, 127]之間的值
? 2 字符映射函數(shù)
? 1> 函數(shù)原型為int toxxxx(int)
? 2> 對(duì)參數(shù)進(jìn)行檢測(cè), 若符合范圍則轉(zhuǎn)換, 否則不變
? int tolower(int); 'A'~'Z' ==> 'a'~'z'
? int toupper(int); 'a'~'z' ==> 'A'~'Z'
? @函數(shù)名稱: isalpha
? 函數(shù)原型: int isalpha(int ch);
? 函數(shù)功能: 檢查ch是否是字母.
? 函數(shù)返回: 1是字母返回 ,否則返回 0.
? 參數(shù)說(shuō)明:
? 所屬文件
? #include
? #include
? int main()
? {
? char ch1='*';
? char ch2='a';
? if(isalnum(ch1)!=0)
? printf("%c is the ASCII number or alphebet\n",ch1);
? else
? printf("%c is not the ASCII number nor alphebet\n",ch1);
? if(isalnum(ch2)!=0)
? printf("%c is the ASCII number or alphebet\n",ch2);
? else
? printf("%c is not the ASCII number nor alphebet\n",ch2);
? return 0;
? }
? @函數(shù)名稱: iscntrl
? 函數(shù)原型: int iscntrl(int ch);
? 函數(shù)功能: 檢查ch是否控制字符(其ASCII碼在0和0x1F之間,數(shù)值為 0-31).
? 函數(shù)返回: 是返回 1,否則返回 0.
? 參數(shù)說(shuō)明:
? 所屬文件:
? #include
? #include
? char chars[]={'A',0x09,'Z'};
? #define SIZE sizeof(chars)/sizeof(char)
? int main()
? {
? int i;
? for(i=0;i