How to concatenate wide-character strings in C

2 Answers

0 votes
// Use wcscat() — to concatenate Wide-Character Strings

#include <stdio.h>
#include <wchar.h>

#define SIZE 30

int main(void)
{
    wchar_t buf[SIZE] = L"c c++";
    wchar_t *s = L" programming";
 
    wcscat(buf, s);
    printf("%ls\n", buf);
  
    return 0;
}

  
/*
run:
  
c c++ programming

*/

 



answered Jun 22, 2017 by avibootz
0 votes
// Use wcscat() — to concatenate Wide-Character Strings

#include <stdio.h>
#include <wchar.h>

#define SIZE 30

int main(void)
{
    wchar_t buf[SIZE] = L"c c++";
    wchar_t *s = L" programming";
    wchar_t *p = NULL;
    
    p = wcscat(buf, s);
    printf("%ls\n", p);
  
    return 0;
}

  
/*
run:
  
c c++ programming

*/

 



answered Jun 22, 2017 by avibootz

Related questions

1 answer 135 views
1 answer 101 views
101 views asked Aug 7, 2024 by avibootz
1 answer 92 views
92 views asked Aug 7, 2024 by avibootz
1 answer 137 views
137 views asked Jun 22, 2017 by avibootz
1 answer 155 views
155 views asked Jun 22, 2017 by avibootz
1 answer 126 views
...