I know some people will say this question is repeated but I really couldn't find a useful answer.
Let's say I have the following program:
#include <iostream>
#include <string>
using std::cout;
int main(){
std::string something;
cout<<"Type something";
std::cin>>something;
}
How can I use setw()
so the output will look like this?
Type something "then after some whitespaces for example 10 the user will start typing"
I tried to use setw()
in output:
#include <iostream>
#include <string>
#include <iomanip>
using std::cout;
int main(){
std::string something;
cout<<std::left<<std::setw(24)<<"Type something";
std::cin>>something;
}
The expected output was supposed to be:
The actual output is: