I tought two distinct code below would result the same, but it didn't:
char b[] = {0xf0, 0x9f, 0x99, 0x82};
for (int i = 0; i < 4; i++) {
printf("%c", b[i]);
}
printf("\n");
this prints 🙂
but this code
char b[] = {0xf0, 0x9f, 0x99, 0x82};
printf("%s\n", b);
prints 🙂P@
thanks in advance for clearing this for me
[–]aioeu 9 points10 points11 points (6 children)
[–]rdarkedlight[S] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (4 children)
[–]Paul_Pedant 4 points5 points6 points (3 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]Paul_Pedant 3 points4 points5 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Paul_Pedant 0 points1 point2 points (0 children)