code snippets(一):isprint(參數),判斷是否為含括空格以內可印字元。
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main(int argc, char *argv[])
{
//isprint(參數)
//參數:是否為含括空格以內可印字元。
//例如:顯示字元,0x20 (' ')到0x7E ('~'),條件成立,回傳非 0 值,否則回傳 0。
if(isprint('~'))
{
printf("參數是顯示字元 0x20(' ')到0x7E('~')\n");
}
else
{
printf("參數非顯示字元 0x20(' ')到0x7E('~')\n");
}
return 0;
}
//Answer:參數是顯示字元 0x20(' ')到0x7E('~')
文章標籤
全站熱搜
