문제

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;
}
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top