quoted in C++

The quoted function in C++ is used to insert and extract quoted strings with embedded space.

Syntax of quoted

quoted(const CharT* s, CharT delim = CharT(' " '), CharT escape = CharT('\\'));

Here,

  • s: String to be printed.
  • delim: Character to be used as delimiter.
  • escape: Character to be used as escape sequence.

Example of quoted

C++




// C++ program to illustrate the use of quoted
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
  
// driver code
int main()
{
  
    string str = "Hello World!";
    cout << "Original string: " << str << endl;
  
    // output string using quoted
    cout << "String after quoted : " << quoted(str) << endl;
  
    return 0;
}


Output

Original string: Hello World!
String after quoted : "Hello World!"


< iomanip > Header in C++

In C++, the <iomanip> header file defines the manipulator functions that are used to manipulate the format of the input and output of our program. It is a part of the input/output library in C++. In this article, we will discuss the functions and facilities provided in the <iomanip> header file in C++ with examples.

Similar Reads

C++ Functions

The following table lists the commonly used functions:...

1. setiosflags in C++

The setiosflag function is used to set the ios_base flags that are specified by its parameter for the stream it is used on....

2. resetiosflags in C++

...

3. setbase in C++

The resetiosflags function in C++ is used to reset or clear ios_base flags specified by parameter mask for the stream it is used on....

4. setw in C++

...

5. setfill in C++

The setbase function is used to set the base according to the argument specified as a parameter to the function....

6. setprecision in C++

...

7. get_money in C++

The setw function is used to change the width of the next input/output field based on the width specified as a parameter to the function....

8. put_money in C++

...

9. get_time in C++

The setfill function is used to change the fill character that is used when the span of the printed data is less than the span specified using setw. It is used to set the fill according to the character specified as a parameter to the function....

10. put_time in C++

...

11. quoted in C++

The setprecision function is used to change the floating-point precision of the float and double data type based on the precision specified as a parameter to the function....