C Standard Libraries C++

wcscat()

Declaration

wchar_t* wcscat(wchar_t* wpDest, const wchar_t* kwpSrc);

Description

This function concatenates two wide-character strings. The resulting concatenation is stored in "wpDest." So, we can look at this function simply appending "kwpSrc" to "wpDest." Note that the wide-character array in "wpDest" must be large enough to hold the concatenation plus a null-terminator. The function simply returns a pointer to the concatenated string or "wpDest."

Example

#include <cwchar>

int main()
{
    wchar_t waWideString1[30] = L"XoaX.net ";
    wchar_t waWideString2[] = L"Video Tutorials";

    // Concatenate the strings into String 1
    wcscat(waWideString1, waWideString2);
    wprintf(L"Concatenation = %ws\n", waWideString1);

    // Keep the window open until "Enter" is pressed
    getwchar();
    return 0;
}

Output

wcscat() Output
 

© 2007–2022 XoaX.net LLC. All rights reserved.