How might one go about printing an em dash in C?
One of these: —
Whenever I do: printf("—")
I just get a ù
in the terminal.
Thank you.
EDIT: The following code is supposed to print out an Xs an Os looking grid with em dashes for the horizontal lines.
int main ()
{
char grid[3][3] = {{'a', 'a', 'a'}, {'a', 'a', 'a'}, {'a', 'a', 'a'}};
int i, j;
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
if (j != 0)
{
printf("|");
}
printf(" %c ", grid[i][j]);
}
if (i != 2)
{
printf("\n——————————————\n");
}
}
return 0;
}
Output: (The "ù"s should be "—"s)
a | a | a
ùùùùùùùùùùùù
a | a | a
ùùùùùùùùùùùù
a | a | a
EDIT: I'm on Windows 10 x64 using Codeblocks 16.01 with C11.
EDIT: I was informed of box characters and the question has morphed into how to print those, hence the title and tag change.
In standard C, you use wide characters and wide strings: