Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
637 views
in Technique[技术] by (71.8m points)

c - printf option

When you are printing a tab character to the standard output using printf in C, it outputs some space which is apparently 4 characters in length.

printf("");

Is there any way by which I can control the tab width in the above case? Any help or suggestion is appreciated.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

That's something controlled by your terminal, not by printf.

printf simply sends a to the output stream (which can be a tty, a file etc), it doesn't send a number of spaces.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...