Search code examples
visual-c++netbeans-7setw

setw not found in MSVC 2013 or NetBeans


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;
}

Solution

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