Home
menubar
rss_feed

Previous Reference C++ Reference <cstring> Next Reference




C++ Reference: strxfrm()





strxfrm()


Declaration

size_t strxfrm(char* cpDest, const char* kcpSrc, size_t qCount);

Description

This function transforms up to "qCount" characters of the null-terminated string "kcpSrc" into a locale-spcific string based on the current locale, which is placed into the string "cpDest." The function returns the length of the tranformed string, not including the null-terminator.

Example

#include <cstdio>
#include <cstring>

int main()
{
    char caSource[] = "XoaX.net";
    char caDest[20];
    // Convert the first four chars of "XoaX.net"
    int iLength = strxfrm(caDest, caSource, 4);
    // Add a null-terminator for printing
    caDest[4] = '\0';
    printf("Conversion: %s\n", caDest);
    printf("Converted bytes: %i\n", iLength);

    return 0;
}


Output:








Previous Reference C++ Reference <cstring> Next Reference




Home | Reference | Play Games! | Blog | Forum | Site Map | Contact Us


shadow bottom image