Skip to content

Instantly share code, notes, and snippets.

@DrewFitz DrewFitz/mathcaps.c
Last active Aug 29, 2015

Embed
What would you like to do?
Who likes unicode allcaps???
/*
Compile: make mathcaps
Usage: ./mathcaps "the string to convert"
*/
#include <stdio.h>
#include <string.h>
int main(int argc, char** argv) {
char* s = argv[1];
int len = strlen(s);
for (int i = 0; i < len; ++i)
{
if (s[i] == ' ') {
printf(" ");
continue;
}
char c = s[i] - 'a';
if (c < 0) c = s[i] - 'A';
if (c < 0 || c > 25) continue;
printf("\xF0\x9D\x90%c", 0x80+c);
}
printf("\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.