Question

I'm trying to write some simple code to learn cout formatting, and both the IDEs listed in the title complain that they can't find/resolve the identifier setw(). Here is my code:

#include <cstdlib>
#include <iostream>
#include <iomanip>

using std::cout;
using std::cin;
using std::endl;
using std::vector;
using std::string;

int main() {
    cout << setw(10) << "Hello";

    return 0;
}
Was it helpful?

Solution

Nevermind! I forgot to using std::setw;.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top