getwchar - C wchar.h

C examples for wchar.h:getwchar

Type

function

From


<cwchar>
<wchar.h>

Description

Get wide character from stdin

Prototype

wint_t getwchar (void);

Parameters

(none)

Return Value

On success, the character read is returned.

On error, WEOF is returned, which indicates failure.

Demo Code


#include <stdio.h>
#include <wchar.h>

int main ()/*ww  w  . j  a v a 2 s.co  m*/
{
  wint_t wc;
  fputws (L"Enter text. Include a dot (.) in a sentence to exit:\n",stdout);
  do {
    wc=getwchar();
    putwchar (wc);
  } while (wc != L'.');
  return 0;
}

Related Tutorials