2
0

wcstod.c 364 B

12345678910111213141516
  1. #include <sys/types.h>
  2. #include <wchar.h>
  3. void attempt(wchar_t *s) {
  4. wchar_t *end;
  5. double result = wcstod(s, &end);
  6. printf("strtod(%lls) = (%f, %lls)\n", s, result, end);
  7. }
  8. int main() {
  9. attempt(L"1.2345wowzah");
  10. attempt(L"53");
  11. attempt(L"-254352.5...");
  12. attempt(L" 19.2 wat");
  13. attempt(L"365.24 29.53");
  14. attempt(L" 29.53");
  15. }