wider.c 498 B

1234567891011121314151617181920
  1. //
  2. // wider.c
  3. #include <stdio.h>
  4. #include <wchar.h>
  5. int main(void)
  6. {
  7. wchar_t value = L'\u00f6';
  8. wchar_t wch = L'I';
  9. wchar_t w_arr[20] = L"am wide!";
  10. printf("%lc %ls %lc\n", wch, w_arr, value);
  11. puts("Enter your grade:");
  12. scanf("%lc", &wch);
  13. puts("Enter your first name:");
  14. scanf("%ls",w_arr);
  15. printf("%lc %ls\n", wch, w_arr);
  16. wchar_t * pw = L"Points to a wide-character string";
  17. int dozen = 12;
  18. wprintf(L"Item %d: %ls\n", dozen, pw);
  19. return 0;
  20. }