fork download
  1. #include <locale.h>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4.  
  5. int main (void)
  6. {
  7. setlocale (LC_ALL, "en_US.UTF-8");
  8. char mba[] = "**********";
  9. char mbb[] = "**********";
  10. size_t n;
  11.  
  12. n = wcstombs (mba, L"äåâ", 6);
  13. printf ("wcstombs: %i: \"%s\"\n", n, mba);
  14.  
  15. n = wcstombs (mbb, L"äåâ", 9);
  16. printf ("wcstombs: %i: \"%s\"\n", n, mbb);
  17.  
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0.02s 3932KB
stdin
Standard input is empty
stdout
wcstombs: 6: "äåâ****"
wcstombs: 6: "äåâ"