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 145 views
1 answer 115 views
115 views asked Aug 7, 2024 by avibootz
1 answer 105 views
105 views asked Aug 7, 2024 by avibootz
1 answer 146 views
146 views asked Jun 22, 2017 by avibootz
1 answer 170 views
170 views asked Jun 22, 2017 by avibootz
1 answer 135 views
...