I just have a question about the string ("%s") format specifier.
is it possible to limit the amount of characters printed with %s? for example, I tried this code, but it did not work, it printed the whole string:
is this possible, or am I just doing it wrong?Code:#include <stdio.h> int main(void) { char str[] = "blehbleh"; printf("%4s", str); return 0; }
any help is appreciated. thank you in advance.