Javatpoint Logo
Javatpoint Logo

Iswspace() Function in C/C++

In this article, we will talk about the C++ iswspace() function's syntax, operation, and return values.

What is the iswspace() function?

The C++ built-in iswspace() function is defined in the <cwctype> header file. The function verifies whether or not the wide character that was passed is a white space character. With the exception of supporting wide characters, this function functions exactly like isspace(). It is the wide character equivalent of isspace(). If the argument passed is a white space (''), the function determines that it is true and returns a non-zero integer value; if not, it returns zero (false).

Syntax:

It has the following syntax:

Parameters:

The function takes one required parameter, ch, which is the wide character to be checked to see if it contains a wide whitespace character. The argument is cast in either WEOF or wint_t. An integral kind of data is stored in wint_t.

Value returned

In the event that the function returns false, it returns zero; in the case of true, it returns any non-zero value.

The above function is demonstrated by the programs below.

Program 1:

Output:

Welcome
to
JavaTPoint
-
Learn
C++
Programming

Program 2:

Output:

This
is
a
small
example.

Conclusion:

In conclusion, it is easy to ascertain whether a wide character is a white-space character using the iswspace() function in C/C++. When working with large character sets, developers can improve the flexibility and portability of their code by utilizing this method from the <wctype.h> header.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA