You can specify on the command-line ISO C11 Standard (/std:c11), ISO C17 (2018) Standard (/std:c17) or Preview - Features from the Latest C Working Draft (std:clatest)
Someone did specify the language standard with his command-line:
• MSVC • cl /EHsc /W4 /Ox /std:clatest fox-star.c
Personally I'd try C latest first, then C17 and end up with C11.
Maybe I will muck around with the code later and see if I can get the stuff to compile within the IDE.
Somewhere in your options you need to tell the compiler to use UTF-8 as the “execution encoding” (as in the compiler’s execution). I think you need an MSVC no older than the one from 2019 for that.
On the command-line you’ll need to add /utf8 to the compile options.
I'm a bit occupied with other things at the moment, but I'll look into that option later. I am using VS 2022, 2019 is but a distant memory.
The usual type of C code I mash on is Desktop WinAPI stuff, the old boilerplate code from the early days of Win app programming. The GUI stuff.
I think I need to use a different console/terminal other than the default conhost.exe as well. The graphics displayed were decidedly muddled looking when I ran the exe.
To reiterate a concern earlier brought up.... the code as originally offered DOES compile without error when compiling as C code and using a C standard other than the VS default. The little problems of warnings and weird looking graphics are fixable if I took the time to investigate and correct them.
Setting /utf-8 at the command-line at either the project level or for the translation unit gets rid of the warnings, but the graphics are still fubared. Even telling the console to use code page 65001 with "chcp 65001".
It does work, yes, it just ain't pretty lookin' when using the Win 10 default console. Something I'm kinda used to.