The precision is not specified in the format string, but as an additional integer value argument preceding the argument that has to be formatted. printf("%.*s", 3, "abcdef") --> abc