4 ms·
Of course, the C version could be just printf("(%.12s)\n", argv[1]);
by _pmf_ 11y ago
Of course, the C version could be just
printf("(%.12s)\n", argv[1]);
- pjmlp 11y agoAssuming using 7 bit ASCII
- _kst_ 11y agoNo, it merely assumes one byte per character. For example, it would work correctly in Latin-1 or EBCDIC. In any case, the problem statement (though it's a bit vague) requires building a truncated string, not just printing it.
- kevin_thibedeau 11y agos/printf/sprintf/
- pjmlp 11y agoIt is enough to have mixed 8 byte code pages and then it is worthless.