blob: 5faabc3abda7284a9ef9038b23a942489c0e418c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#include <locale.h>
#include <stdio.h>
#include <wchar.h>
int main(void) {
setlocale(LC_CTYPE, "en_US.UTF-8");
wint_t next, prev = WEOF;
while (WEOF != (next = getwchar())) {
if (next == L'\b') {
prev = WEOF;
} else {
if (prev != WEOF) putwchar(prev);
prev = next;
}
}
if (prev != WEOF) putwchar(prev);
}
|