wcstoimax() and wcstoumax() function in C/C++The wcstoimax() and wcstoumax() function in C/C++ operate in the same way as the strtoimax() and strtoumax() functions in C++, other than they are used to convert the data of a wide string (wstring) to an integral number of the given base. This function is defined in the header file cinttypes. Header file: wcstoimax() method:wcstoimax() is an abbreviation for "Wide Character String to Maximum Integer". It transforms a wide-character string to a numerical maximum-width signed integer of type intmax_t. It can convert various bases (e.g., decimal, hexadecimal, octal) according to the format of the input text. Syntax:It has the following syntax: Parameters:npt: The number to be translated into a wide-character string. endpt: A pointer to wide characters containing the address that represents the function's first incorrect character in the given input string. bases: The number system's base (for example, 10 for decimal, 16 for hexadecimal, and so on). Return Value:The function returns two values, which are as follows:
Example:Output: Programming in base 36 is 94215099711813100 in base 10 The given input String is = Programming The Number with the base 30 in the given string 15309807264430906 in base 10 the end of the string points to wcstoumax() method:The wcstoumax() method transforms the wide-character string npt to the integer type uintmax_t. Base input values are 0 and in the range of 2-36. The wcstoumax() function is the same as the wcstoul() and wcstoull() functions. The only distinction is that the returned value corresponds to the type uintmax_t. Syntax:It has the following syntax: Parameters:npt: The number to be translated into a wide-character string. endpt: It is a pointer that contains wide characters containing the address that represents the function's first incorrect character in the given input string. bases: The number system's base (for example, 10 for decimal, 16 for hexadecimal, and so on). Example:Output: The given input String = 123abc The Value stored in the number is: 123 The end of the string points to abc The given input String = abcdeed The Value stored in the number is: 0 The end of the string points to abcdeed Uses of wcstoimax() and wcstoumax() function:
|
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India