Back to index

glibc  2.9
tst-wcstof.c
Go to the documentation of this file.
00001 #define _GNU_SOURCE 1
00002 #include <wchar.h>
00003 #include <stdio.h>
00004 #include <string.h>
00005 #include <wctype.h>
00006 
00007 int
00008 main (void)
00009 {
00010   int result = 0;
00011   char buf[100];
00012   wchar_t tmp[3];
00013   tmp[0] = '8';
00014   tmp[1] = '1';
00015   tmp[2] = 0;
00016 
00017   snprintf (buf, 100, "%S = %f", tmp, wcstof (tmp, NULL));
00018   printf ("\"%s\" -> %s\n", buf,
00019          strcmp (buf, "81 = 81.000000") == 0 ? "okay" : "buggy");
00020   result |= strcmp (buf, "81 = 81.000000") != 0;
00021 
00022   return result;
00023 }