tags:

views:

531

answers:

1

How can I print a non-null-terminated string using printf, assuming that I know the length of the string at runtime?

+16  A: 
printf("%.*s", length, string);
KennyTM
Thanks for the quick answer!
Mike