Last active
February 23, 2024 18:42
-
-
Save colematt/f2b9ec89612f291f5fdca473b4cd195d to your computer and use it in GitHub Desktop.
[Print Control Characters] #c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <locale.h> | |
#include <stdio.h> | |
#include <wchar.h> | |
/* REFERENCES | |
* Control Block: http://unicode.org/charts/PDF/U0000.pdf | |
* Control Pictures: http://unicode.org/charts/PDF/U2400.pdf | |
*/ | |
int main(int argc, char* argv[]) { | |
setlocale(LC_CTYPE, ""); | |
// Print a single unicode character | |
wchar_t star = 0x2605; | |
wprintf(L"%lc\n", star); | |
// Print a block of unicode characters | |
// corresponding to the ASCII ctrl chars | |
for (wchar_t w = 0; w <= 0xA; w++) { | |
wprintf(L"%lc ", w + 0x2400); | |
} | |
printf("\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment