1 of 6

1

01/03/2023

Library functions

2 of 6

ctype.h

  • int isalpha(int c); returns true if c is an alphabetical letter and 0 otherwise.
  • int islower(int c);
  • int isupper(int c);
  • int isdigit(int c); returns a true value if c is digit and 0 (false) otherwise.

2

01/03/2023

3 of 6

ctype.h

  • int tolower(int c);

If c is an upper-case letter, it returns the corresponding lower-case letter; otherwise it returns c

  • int toupper(int c);
  • int isspace(int c); returns non-zero if it is space; 0, otherwise;

3

01/03/2023

4 of 6

stdlib.h

  • int atoi(const char *ptr);
  • double atof(const char *ptr);
  • long atol(const char *ptr);

4

01/03/2023

5 of 6

stdio.h

  • int getchar(void);
  • int putchar(int c);
    • It returns the character written, or EOF for an error.

5

01/03/2023

6 of 6

stdio.h

  • int sprintf(char *s, const char *format, …);
    • Same as printf except that the output is written into the string s, terminated with ‘\0’. The return value is the number of characters that are written into s.
  • int sscanf(char *s, const char *format, …);
    • Same as scanf except that the input characters are taken from string s. It returns number of items (variables) that are read, or EOF if an error occurs.

6

01/03/2023