ctype.h Flashcards

1
Q

What is isalnum()?

int isalnum(int character);

A

a letter (A to Z or a to z) or a digit (0 to 9)

The is… functions test the given character and return a nonzero (true) result if it satisfies the following conditions. If not, then 0 (false) is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is isalpha()?

int isalpha(int character);

A

a letter (A to Z or a to z)

The is… functions test the given character and return a nonzero (true) result if it satisfies the following conditions. If not, then 0 (false) is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is iscntrl()?

int iscntrl(int character);

A

any control character (0x00 to 0x1F or 0x7F)

The is… functions test the given character and return a nonzero (true) result if it satisfies the following conditions. If not, then 0 (false) is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is isdigit()?

int isdigit(int character);

A

a digit (0 to 9)

The is… functions test the given character and return a nonzero (true) result if it satisfies the following conditions. If not, then 0 (false) is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is isgraph()?

int isgraph(int character);

A

any printing character except for the space character (0x21 to 0x7E)

The is… functions test the given character and return a nonzero (true) result if it satisfies the following conditions. If not, then 0 (false) is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is islower()?

int islower(int character);

A

a lowercase letter (a to z)

The is… functions test the given character and return a nonzero (true) result if it satisfies the following conditions. If not, then 0 (false) is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is isprint()?

int isprint(int character);

A

any printing character (0x20 to 0x7E)

The is… functions test the given character and return a nonzero (true) result if it satisfies the following conditions. If not, then 0 (false) is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is ispunct()?

int ispunct(int character);

A

any punctuation character (any printing character except for space character or isalnum)

The is… functions test the given character and return a nonzero (true) result if it satisfies the following conditions. If not, then 0 (false) is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is isspace()?

int isspace(int character);

A

a whitespace character (space, tab, carriage return, new line, vertical tab, or formfeed)

The is… functions test the given character and return a nonzero (true) result if it satisfies the following conditions. If not, then 0 (false) is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is isupper()?

int isupper(int character);

A

an uppercase letter (A to Z)

The is… functions test the given character and return a nonzero (true) result if it satisfies the following conditions. If not, then 0 (false) is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is isxdigit()?

int isxdigit(int character);

A

a hexadecimal digit (0 to 9, A to F, or a to f)

The is… functions test the given character and return a nonzero (true) result if it satisfies the following conditions. If not, then 0 (false) is returned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is tolower()?

int tolower(int character);

A

If the character is an uppercase character (A to Z), then it is converted to lowercase (a to z)

The to… functions provide a means to convert a single character. If the character matches the appropriate condition, then it is converted. Otherwise the character is returned unchanged.

Example:

    #include
     #include
     #include
    int main(void)
     {
       int loop;
       char string[]="THIS IS A TEST";
  for(loop=0;loop
     string[loop]=tolower(string[loop]);

  printf("%s\n",string);
   return 0;
 }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is toupper()?

int toupper(int character);

A

If the character is a lowercase character (a to z), then it is converted to uppercase (A to Z)

The to… functions provide a means to convert a single character. If the character matches the appropriate condition, then it is converted. Otherwise the character is returned unchanged.

Example:

#include<ctype.h><br>	 #include<stdio.h><br>	 #include<string.h></string.h></stdio.h></ctype.h>
    int main(void)
     {
       int loop;
       char string[]="THIS IS A TEST";
  for(loop=0;loop<strlen></strlen>         string[loop]=tolower(string[loop]);

  printf("%s\n",string);
   return 0;
 }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly