/* Copyright (c) 2001-2004 by SoftIntegration, Inc. All Rights Reserved */
/* This is an example of the function wcstod(const wchar_t*, wchar_t**).  
   This converts a strint to a double value.
*/
#include <wchar.h>
#include <stdlib.h>

int main() { 
    wchar_t nptr[100];
    wchar_t *endptr;        
    double x;
    char *line;
    int len;

    line = "3.1415926This stopped it";
    len = strlen(line);
    mbstowcs(nptr, line, len);
    x = wcstod(nptr, &endptr);
    printf("Original string: ");
    fputws(nptr, stdout);
    printf("\nDouble representation: %f\n", x); 
}

