이 기사에서는 C++ STL에서 iswgraph() 함수의 작동, 구문 및 예제에 대해 논의할 것입니다.
iswgraph()는
그래픽 표현이 있는 와이드 문자는 무엇입니까?
화면에 인쇄할 수 있는 모든 와이드 문자는 그래픽 표현이 있는 문자입니다. 이스케이프 문자는 그래픽 표현이 있는 문자를 제외하고.
구문
int iswgraph(ch);
매개변수
이 함수는 와이드 문자 유형의 ch 매개변수 하나만 허용합니다.
반환 값
정수 값을 반환합니다. 즉, 0은 와이드 문자가 그래픽으로 표시되지 않고 와이드 문자가 그래픽으로 표시되는 경우 0이 아닌 값입니다.
예시
Input: iswgraph(‘?’); Output: It has a graphical representation. Input: iswgraph(‘ ’); Output: It doesn’t have a graphical representation.
예시
#include <cwctype>
#include <iostream>
using namespace std;
int main() {
wchar_t ch_1 = '%';
wchar_t ch_2 = ')';
if(iswgraph(ch_1))
wcout<< "It has graphical representation: "<<ch_1;
else
wcout<< "It doesn't have graphical representation: "<<ch_1;
if (iswgraph(ch_2))
wcout<< "\nIt has graphical representation: "<<ch_2;
else
wcout<< "\nIt doesn't have graphical representation: "<<ch_2;
return 0;
} 출력
위의 코드를 실행하면 다음 출력이 생성됩니다 -
It has graphical representation: % It has graphical representation: )
예시
#include <cwctype>
#include <iostream>
using namespace std;
int main() {
wchar_t ch_1 = '9';
wchar_t ch_2 = '/n';
if(iswgraph(ch_1))
wcout<< "It has graphical representation: "<<ch_1;
else
wcout<< "It doesn't have graphical representation: "<<ch_1;
if (iswgraph(ch_2))
wcout<< "\nIt has graphical representation: "<<ch_2;
else
wcout<< "\nIt doesn't have graphical representation: "<<ch_2;
return 0;
} 출력
위의 코드를 실행하면 다음 출력이 생성됩니다 -
It has graphical representation: 9 It doesn't have graphical representation: ?