printf \t option

后端 未结 2 1871
萌比男神i
萌比男神i 2020-12-16 10:38

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.



        
2条回答
  •  清歌不尽
    2020-12-16 11:03

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

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

提交回复
热议问题