The wcstof() functions convert the initial portion of the wide-character string pointed to by str to a float point value. The str parameter points to a sequence of characters that can be interpreted as a numeric floating-point value. These functions stop reading the string at the first character that it cannot recognize as part of a number i.e. if the first character is any of any type except numbers the function terminates there only. This character can be the wchar_t null character at the end of the string.
The standard library functons beginning with ‘wcs’ are declared in wchar.h library in C.
float wcstof (const wchar_t* str, wchar_t** endptr); Parameters : str : C wide string beginning with the representation of a floating-point number. endptr : Reference to an already allocated object of type wchar_t*, whose value is set by the function to the next character in str after the numerical value. This parameter can also be a null pointer. Return value : Floating point value corresponding to the contents of str on success. If the converted value falls out of range of corresponding return type, range error occurs and is returned.
58.15 18.52 Value of Pie is 3.14 .
GeeksforGeeks has prepared a complete interview preparation course with premium videos, theory, practice problems, TA support and many more features. Please refer Placement 100 for details
- difftime() C library function
- isgraph() C library function
- How to print range of basic data types without any library function and constant in C?
- SDL library in C/C++ with examples
- snprintf() in C library
- wprintf() and wscanf in C Library
- C Library math.h functions
- How to add "graphics.h" C/C++ library to gcc compiler in Linux
- Difference between Header file and Library
- ctype.h(<cctype>) library in C/C++ with Examples
- Unordered Sets in C++ Standard Template Library
- Inbuilt library functions for user Input | scanf, fscanf, sscanf, scanf_s, fscanf_s, sscanf_s
- How to call function within function in C or C++
- arc function in C
- putchar() function in C