如果是英文字母,不論大小寫,傳回非零值,否則為零。
#include <iostream>
#include <string>
using namespace std;
//-----------------------
int main()
{
char en = 'a' ;
char ch = 'A' ;
int num = 50 ;
cout << isalpha(en) << endl ;
cout << isalpha(ch) << endl ;
cout << isalpha(num) << endl ;
system("pause");
return 0;
}
執行結果
請先 登入 以發表留言。