code snippets(一):isalnum(參數),判斷是否為字母或數字。
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int main(int argc, char *argv[])
{
//isalnum(參數)
//參數:是否為字母或數字,條件成立,回傳非 0 值,否則回傳 0。
int tf=isalnum('5');
//if(isalnum('5'))
if(tf != 0)
{
printf("字元或數字\n");
}
else
{
printf("非字元或數字\n");
}
return 0;
}
//Answer:字元或數字
文章標籤
全站熱搜

留言功能已依作者設定調整顯示方式