선언
<cctype> or ctype.h
정의
_Check_return_ _CRT_JIT_INTRINSIC _CRTIMP int __cdecl isalpha(_In_ int _C);
설명
알파벳(대, 소문자) 이외는 0으로 반환합니다.
파라미터
_In_ int _C : 아스키코드값(int) or 문자를 넣으면 됩니다.
반환값
대문자 : 1
소문자 : 2
이외 : 0
예제
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | #include <stdio.h> #include <ctype.h> #include <windows.h> int main(_In_ int _Argc, _In_reads_(_Argc) _Pre_z_ char ** _Argv, _In_z_ char ** _Env) { for (int i = 0; i < 43; i++) { //HEX /*if (i < 42) { printf("%d [ 0x%x = %d // 0x%x = %d // 0x%x = %d]\n", i, i * 3, isalpha(i * 3), (i * 3) + 1, isalpha((i * 3) + 1), (i * 3) + 2, isalpha((i * 3) + 2)); } else { printf("%d [ 0x%x = %d // 0x%x = %d]\n", i, i * 3, isalpha(i * 3), (i * 3) + 1, isalpha((i * 3) + 1)); }*/ //Character if (i < 42) { printf("%d [ %c = %d // %c = %d // %c = %d]\n", i, i * 3, isalpha(i * 3), (i * 3) + 1, isalpha((i * 3) + 1), (i * 3) + 2, isalpha((i * 3) + 2)); } else { printf("%d [ %c = %d // %c = %d]\n", i, i * 3, isalpha(i * 3), (i * 3) + 1, isalpha((i * 3) + 1)); } } system("pause"); return 0; } | cs |
결과
'Language & API > C_기초' 카테고리의 다른 글
isdigit(_In_ int _C) 사용법 (0) | 2017.05.22 |
---|---|
iscntrl(_In_ int _C) 사용법 (0) | 2017.05.19 |
isblank(_In_ int _C) 사용법 (0) | 2017.05.19 |
isalnum(_In_ int _C)사용법 (0) | 2017.05.18 |
assert(_Expression) 사용법 (0) | 2017.05.15 |