width(), precision(), and fill(), functions in C++

width() function is used to specify minimum field width. Syntax of width() function:

streamsize width(streamsize w);

precision() function is used to find out the number of integers displayed after a decimal point. Syntax of precision() function:

streamsize precision(streamsize p);

fill() function is used to fill a field with spaces. Syntax of fill() function:

char fill(char ch);

Leave a Reply