(This article does not discuss tab and space indentation issues)
During programming, we often use multiple spaces or tabs to separate two strings. What are the differences between the two strings in the display effect?
Compare the output results of the following two lines of code:
Code 1:
Printf ();
Code 2:
Printf (););
Code 1 output:
Code 2 output result:
Obviously, the two 1 s on the right side of the output result of code 1 are aligned up and down, while the two 1 s on the right side of the output result of Code 2 are not aligned up and down, the reason why the output result of Code 2 is not correct is easy to understand, but why is the two 1 in the output result of code 1 aligned?
This involves skipping a few spaces on the tab \ t.
\ T whether to skip a few spaces is not specified, there is no standard, each output device will require their own device \ t will locate an integer unit multiple, for example, some devices require that \ t be positioned at an integer multiple of 8 characters. If a string contains n characters before the Tab character \ t, \ t will skip 8-n % 8 spaces.