Wide character operation functions in MFC

Source: Internet
Author: User
Tags uppercase character
Description of common C functions of wide character Functions
Iswalnum () isalnum () test whether the character is a number or letter
Iswalpha () isalpha () test whether the character is a letter
Iswcntrl () iscntrl () test whether the character is a controller
Iswdigit () isdigit () test whether the character is a number
Iswgraph () isgraph () test whether the character is visible
Iswlower () islower () test whether the character is a lowercase character
Iswprint () isprint () test whether the character is printable
Iswpunct () ispunct () test whether the character is a punctuation mark
Iswspace () isspace () test whether the character is a blank sign
Iswupper () isupper () test whether the character is an uppercase character
Iswxdigit () isxdigit () test whether the character is a hexadecimal number

Case sensitivity conversion:
Description of common C functions of wide character Functions
Towlower () tolower () converts characters to lowercase letters
Towupper () toupper () converts the character to uppercase

Character comparison:
Description of common C functions of wide character Functions
Wcscoll () strcoll () Comparison string

Date and Time conversion:
Wide character Function Description
Strftime () sets the format date and time based on the specified string format and locale
Wcsftime () sets the format date and time based on the specified string format and locale, and returns the wide string
Strptime () converts a string to a time value based on the specified format, which is the reverse process of strftime.

Print and scan strings:
Wide character Function Description
Fprintf ()/fwprintf () format the output using the vararg Parameter
Fscanf ()/fwprintf () format read
Printf () uses the vararg parameter to format the output to the standard output.
Scanf () reads formatted data from standard input
Sprintf ()/swprintf () formatted as a string based on the vararg parameter table
Sscanf ()/swscanf () is formatted and read as a string
Vfprintf ()/vfwprintf () format the output to a file using the stdarg parameter table
Vprintf () uses the stdarg parameter table to format the output to the standard output.
Vsprintf ()/vswprintf () format the stdarg parameter table and write it to the string

Digital Conversion:
Description of common C functions of wide character Functions
Wcstod () strtodd () converts the initial part of a wide character to a double-precision floating point number.
Wcstol () strtol () converts the initial part of a wide character to a long integer.
Wcstoul () strtoul () converts the initial part of a wide character to an unsigned long integer.

Multi-Byte Character and wide character conversion and operations:
Wide character Function Description
Mblen () determines the number of characters in bytes based on locale settings
Mbstowcs () converts a multi-byte string to a wide string.
Mbtowc ()/btowc () converts multi-byte characters into wide characters
Wcstombs () converts a wide string to a multi-byte string.
Wctomb ()/wctob () converts a wide character to a multi-Byte Character

input and output:
wide character function common C function description
fgetwc () fgetc () read a character from the stream and convert it to a wide character
fgetws () fgets () read a string from the stream and convert it to a wide string
fputwc () fputc () convert a wide character to a multi-Byte Character and output it to the standard output.
fputws () fputs () convert a wide string to a multi-Byte Character and output it to the standard output string.
getwc () GETC () reads characters from standard input and converts them to wide characters.
getwchar () getchar () reads characters from standard input, and convert it to a wide character
none gets () using fgetws ()
putwc () putc () converts a wide character to a multi-Byte Character and writes it to the standard output.
putwchar () putchar () converts a wide character to a multi-Byte Character and writes it to the standard output.
none puts () use fputws ()
ungetwc () ungetc () to put a wide character back into the input stream

String operation:
Description of common C functions of wide character Functions
Wcscat () strcat () concatenates a string to the end of another string
Wcsncat () strncat () is similar to wcscat () and specifies the bond length of the bond string.
Wcschr () strchr () finds the first position of the substring
Wcsrchr () strrchr () searches for the first position of the substring from the tail.
Wcspbrk () strpbrk () Searches from the character string for the first occurrence of any character in the other string
Wcswcs ()/wcsstr () strchr () searches for the first occurrence location of another string in one string
Returns the initial number of records that do not contain the second string.
Wcsspns () strspns () returns the initial number of strings containing the second string.
Wcscpy () strcpy () Copy string
Wcsncpy () strncpy () is similar to wcscpy () and specifies the number of copies.
Wcscmp () strcmp () compares two wide strings
Wcsncmp () strncmp () is similar to wcscmp () and also specifies the number of character strings to be compared.
Wcslen () strlen () gets the number of wide strings
Wcstok () strtok () Splits a wide string into a series of strings Based on the identifier
Wcswidth () None to get the width of the wide string
Wcwidth () None

In addition, wmemcpy (), wmemchr (), wmemcmp (), wmemmove (), and wmemset () for memory operations ().

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.