[C] About Library <ctype.h>

숭글·2022년 7월 11일

studying before implementing some functions of <ctype.h> Lib.

#include <ctype.h>

  • isalpha()
  • isdigit()
  • isalnum()
  • isascii()
  • isprint()
  • toupper()
  • tolower()

int isalpha(int c);

tests for any character for which isupper or islower is true.

return values
: 0 - if the character tests false.
non-zero - if the character tests true.

int isdigit(int c);

tests for a decimal digit character.

  • diffence with isnumber()
    -isdigit() only recognizes decimal number. but isnumber() may recognizes additional characters depending on the current locale setting.

return values
: 0 - if the character tests false.
non-zero - if the character tests true.

int isalnum(int c);

tests for any character for which isalpha or isdigit is true.

return values
: 0- if the character tests false.
non-zero if the character tests true.

int isascii(int c);

tests for an ASCII character, which is any character between 0 and octal 0177 inclusive.

return values
: 0- if the character tests false.
non-zero if the character tests true.

int isprint(int c);

tests for any printing character, including space(ascii num 32).

return values
: 0- if the character tests false.
non-zero if the character tests true.

int toupper(int c);

converts a lower-case letter to the corresponding upper-case letter.
The argument must be representable as an unsigned char or the value of EOF.

return values
: the corresponding upper-case letter - if there is one and If the argument is a lower-case letter.
unchanged value - otherwise.

profile
Hi!😁 I'm Soongle. Welcome to my Velog!!!

0개의 댓글