How to write and append formatted data to wide string in C

1 Answer

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

int main ()
{
    wchar_t buffer[128];
    
    long b = 900000000;
    int len = swprintf(buffer, 32, L"%d b = %ld : ", 88888, b);

    int c = 5872;
    swprintf(buffer + len, 128 - len -1, L"and c = %d\n", c);

    fputws(buffer, stdout);

    return 0;
}




/*
run:

88888 b = 900000000 : and c = 5872

*/

 



answered Jun 19, 2021 by avibootz

Related questions

...