How to print a wide string character by character in C

1 Answer

0 votes
#include <stdio.h>

int main(void)
{
    wchar_t str[] = L"C 17 Programming!";

    int i = 0;
    while (str[i]) {
        wprintf(L"%lc\n", str[i]);
        i++;
    }

    return 0;
}





/*
run:

C

1
7

P
r
o
g
r
a
m
m
i
n
g
!

*/

 



answered Jul 31, 2022 by avibootz

Related questions

2 answers 149 views
149 views asked Feb 11, 2023 by avibootz
1 answer 138 views
138 views asked Jul 31, 2022 by avibootz
1 answer 176 views
1 answer 133 views
...