English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

C / C ++iswblank() function in

The functioniswblank()Used to check if the passed wide character is a blank. It is basically a space character and also considers tabs (\t). This function is in the C language's "ctype.h" header file and C ++Declared in the "cctype" header file of the language.

This isisblank()C ++Language syntax,

int iswblank(wint_t char);

This isiswblank()C ++Language example,

Example

#include <ctype.h>
#include <iostream>
using namespace std;
int main() {
   wchar_t s[] = L"The space between words.";
   int i = 0;
   int count = 0;
   while(s[i]) {
      char c = s[i++;
      if (iswblank(c)) {
         count++;
      {}
   {}
   cout << "\nNumber of blanks in sentence: " << count << endl;
   return 0;
{}

Output result

Number of blanks in sentence : 5

In the above program, a string is passed in the variable s. This functioniswblank()Used to check for spaces or spaces in the passed string, as shown in the following code snippet.

wchar_t s[] = L"The space between words.";
int i = 0;
int count = 0;
while(s[i]) {
   char c = s[i++;
   if (iswblank(c)) {
      count++;
   {}
{}