ios manipulators right() function in C++ Last Updated : 02 Sep, 2019 Comments Improve Suggest changes Like Article Like Report The right() method of stream manipulators in C++ is used to set the adjustfield format flag for the specified str stream. This flag sets the adjustfield to right. It means that the number in the output will be padded to the field width by inserting fill characters at the start. Syntax: ios_base& right (ios_base& str) Parameters: This method accepts str as a parameter which is the stream for which the format flag is affected. Return Value: This method returns the stream str with internal format flag set. Example 1: CPP // C++ code to demonstrate // the working of right() function #include <iostream> using namespace std; int main() { // Initializing the integer double x = -1.23; cout.precision(5); // Using right() cout << "right flag: "; cout.width(12); cout << right << x << endl; return 0; } Output: right flag: -1.23 Example 2: CPP // C++ code to demonstrate // the working of right() function #include <iostream> using namespace std; int main() { // Initializing the integer double x = -1.23; cout.precision(5); // Using right() cout << "right flag: "; cout.width(12); cout << right << x << endl; return 0; } Output: right flag: -1.23 Reference: http://www.cplusplus.com/reference/ios/right/ Comment More infoAdvertise with us Next Article ios manipulators right() function in C++ G guptayashgupta53 Follow Improve Article Tags : Misc C++ cpp-ios cpp-manipulators Practice Tags : CPPMisc Similar Reads ios manipulators oct() function in C++ The oct() method of stream manipulators in C++ is used to set the baseline format flag for the specified str stream. This flag sets the baseline for Octal numbers. Hence the output shows the number in Octal base. Syntax: ios_base& oct (ios_base& str) Parameters: This method accepts str as a 1 min read ios manipulators unitbuf() function in C++ The unitbuf() method of stream manipulators in C++ is used to set the unitbuf format flag for the specified str stream. This flag flushes the associated buffer after each operation. Syntax: ios_base& unitbuf (ios_base& str) Parameters: This method accepts str as a parameter which is the stre 2 min read ios manipulators skipws() function in C++ The skipws() method of stream manipulators in C++ is used to set the skipws format flag for the specified str stream. This flag skips the whitespaces in the input stream before the first non-whitespace character. Syntax: ios_base& skipws (ios_base& str) Parameters: This method accepts str as 2 min read ios manipulators showpoint() function in C++ The showpoint() method of stream manipulators in C++ is used to set the showpoint format flag for the specified str stream. This flag always displays the floating point values along with their decimal values. Syntax: ios_base& showpoint (ios_base& str) Parameters: This method accepts str as 1 min read ios manipulators nounitbuf() function in C++ The nounitbuf() method of stream manipulators in C++ is used to clear the showbase format flag for the specified str stream. This flag does not flushes the associated buffer after each operation. Syntax: ios_base& nounitbuf (ios_base& str) Parameters: This method accepts str as a parameter w 2 min read Like