
- C Programming Tutorial
- C - Home
- C - Overview
- C - Environment Setup
- C - Program Structure
- C - Basic Syntax
- C - Data Types
- C - Variables
- C - Constants
- C - Storage Classes
- C - Operators
- C - Decision Making
- C - Loops
- C - Functions
- C - Scope Rules
- C - Arrays
- C - Pointers
- C - Strings
- C - Structures
- C - Unions
- C - Bit Fields
- C - Typedef
- C - Input & Output
- C - File I/O
- C - Preprocessors
- C - Header Files
- C - Type Casting
- C - Error Handling
- C - Recursion
- C - Variable Arguments
- C - Memory Management
- C - Command Line Arguments
- C Programming useful Resources
- C - Questions & Answers
- C - Quick Guide
- C - Useful Resources
- C - Discussion
iswpunct() function in C/C++
The function iswpunct() is used to check that the passing wide character is a punctuation or not. It returns zero, if it is not a punctuation, otherwise it returns a non-zero value. It is declared in “cwctype” header file.
Here is the syntax of iswpunct()
int iswpunct(wint_t character);
Here is an example of iswpunct()
Example
#include<cwctype> #include<stdio.h> using namespace std; int main() { wint_t a = '!'; wint_t b = 'a'; if(iswpunct(a)) printf("The character is a punctuation."); else printf("\nThe character is not a punctuation."); if(iswpunct(b)) printf("\nThe character is a punctuation."); else printf("\nThe character is not a punctuation."); return 0; }
Output
The character is a punctuation. The character is not a punctuation.
In the above program, two wide characters are declared as a and b. The characters are checked that passed character is a punctuation or not.
wint_t a = '!'; wint_t b = 'a'; if(iswpunct(a)) printf("The character is a punctuation."); else printf("\nThe character is not a punctuation."); if(iswpunct(b)) printf("\nThe character is a punctuation."); else printf("\nThe character is not a punctuation.");
- Related Articles
- iswpunct() function in C++ STL
- iswblank() function in C/C++
- strchr() function in C/C++
- strtod() function in C/C++
- memmove() function in C/C++
- memcpy() function in C/C++
- atexit() function in C/C++
- raise() function in C/C++
- mbrlen() function in C/C++
- strftime() function in C/C++
- iswlower() function in C/C++
- towupper() function in C/C++
- iswdigit() function in C/C++
- ldexp() function in C/C++
- wcstoll() function in C/C++

Advertisements