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

Popular posts from this blog

css - Text drops down with smaller window -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

ruby on rails - Authlogic - how to make a registration and don't log in the new account? -