close
如果是英文字母或十進位數字,傳回非零值,否則為0。
#include <iostream>
#include <string>
using namespace std;
//-----------------------
int main()
{
char en = 'a' ;
char ch = '^' ;
int num = 50 ;
cout << "十進位數字傳回非零值: " << isalnum(num) << endl ;
cout << "英文字母傳回非零值: " << isalnum(en) << endl ;
cout << "非英文字母或數字傳回零: " << isalnum(ch) << endl ;
system("pause");
return 0;
}
執行結果
全站熱搜