#include
#include
#include
using namespace std;
//m*n 阶矩阵
class M
{
public:
M(int m, int n);
M(M& m);
virtual ~M();
int m;
int n;
private:
int *a;
friend istream& operator>>( istream& in, M& m );
friend ostream& operator>( istream& in, M& m )
{
cout (*(m.a+i*m.n+j));
}
}
return in;
}
//输出矩阵
ostream& operator>a>>b;
M c = a + b;
cout<<a<<"--------"<<endl< 这个是VC6以前的写法。 #include using namespace std; 这个是标准库的写法。标准库把这些个文件都放到std这个namespace里面了。 可以到VC\include看看和VC6.0的区别,是iostream而不是iostream.h。 注意和是两个不同的东西是STL库是兼容于c的库所有STL库