我正在尝试使用 iomanip 格式化我的代码输出:
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2) << "Modified: resistor "<< rname << " to "<< res << " Ohms"<<endl;
但我在第三行收到一个错误:
error: invalid operands of types 'std::streamsize' and 'const char [20]' to binary 'operator<<'|