报错:
error C2143: 语法错误 : 缺少“;”(在“&”的前面)
代码:
#include <iostream> ostream & << (ostream& os, int i) { return os << i ; }
解决方法:加入using namespace std;
解决报错后代码:
#include <iostream> using namespace std; ostream & << (ostream& os, int i) { return os << i ; }
Or
#include <iostream> std::ostream & << (std::ostream& os, int i) { return os << i ; }
原文地址:https://www.cnblogs.com/2018shawn/p/10198419.html
时间: 2024-12-14 07:15:12