1. So, what is the isspace function in C?
This function in C language checks if the passed char
value is a white-space character. The return value of isspace is an int
.
If the argument is a white-space value
, function isspace returns non-zero value.
If the argument is not a white-space value, the isspace function returns 0.
The isspace function is defined in the <ctype.h> library. To use this function, we have to include this
header file into the C program (e.g. #include
<ctype.h>
).
Example 1: Usage of the isspace function in C.
#
include
<ctype.h>
#
include
<stdio.h>
int
main(
void
)
{
printf
(
"%d",
isspace
(
'\n'
));
printf
(
"%d",
isspace
(
'1'
));
return
(
0
);
}
Possible output:
0