Reputation: 1112
I tried
printf("%s %15s", string1, string2);
and I found out that this kind of left padding depends the distance from the first string, what if I want an absolute left padding counting from the left most?
Upvotes: 1
Views: 314
Reputation: 64308
You want to pad the first string on the right, instead of padding the second sting on the left:
printf("%-15s %s",string1,string2);
Upvotes: 8