c - How to have absolute padding in printf()? -
i tried
printf("%s %15s", string1, string2);
and found out kind of left padding depends distance first string, if want absolute left padding counting left most?
you want pad first string on right, instead of padding second sting on left:
printf("%-15s %s",string1,string2);
Comments
Post a Comment