Home  >  Article  >  Backend Development  >  What does \t mean in c language

What does \t mean in c language

hzc
hzcOriginal
2020-07-01 15:32:45127578browse

The [\t] in C language represents the horizontal tab character, which is equivalent to pressing the TAB key on the keyboard. The width is usually equivalent to 8 spaces, but some software allows the width of the tab to be set. , valid in strings represented by double quotes or delimiters, and invalid in strings represented by single quotes.

What does \t mean in c language

The [\t] in C language represents the horizontal tab character, which is equivalent to pressing the TAB key on the keyboard. Usually the width is equivalent to 8 The position of the space, but some software allows you to set the width of the tab, which is valid in strings represented by double quotes or delimiters, but invalid in strings represented by single quotes.

Generally speaking, its output display in the terminal and file is equivalent to pressing the TAB key on the keyboard. In a typical system, horizontal tabs will occupy 8 columns. At the same time, the initial position

that the horizontal tab begins to occupy is column 8*n (the subscript of the first column is 0).

#include
#include
int main(int argc, char* argv[])
{    
     printf("ab c");        
     printf("\t");        
     printf("333312345e\r")
     printf("12345");     
     printf("jk\n");       
     system("pause");   
     return 0;
}

The meaning of other escape characters

What does \t mean in c language

Recommended tutorial: "c Language Tutorial"

The above is the detailed content of What does \t mean in c language. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn