internal in C++

internal: This is used to adjust the field by inserting characters at an internal position. This sets the adjusted field format flag for the str stream to internal.

Parameters: 

str: Stream object whose adjust field format flag is affected.

Syntax:

internal<<str

For Example:

str = "abcd"

width(10)<<internal<<str => It return     "abcd"

     abcd 

Approach

C++

#include <bits/stdc++.h>
using namespace std;

int main()
{
    cout.width(10);
    cout << internal << "abcd\n";

    return 0;
}


No comments:

Post a Comment