主题:关于vect(class)问题
#include <iostream>
#include <iomanip>
#include <vector>
using namespace std;
class TT{
private:
int b;
public:
TT(int a){
a=b;
cout < <"new " < <endl;}
};
void main(){
vector <TT> v(10);
}
报错:microsoft visual studio\vc98\include\vector(41) : error C2512: 'TT::TT' : no appropriate default constructor available
WHY??
#include <iomanip>
#include <vector>
using namespace std;
class TT{
private:
int b;
public:
TT(int a){
a=b;
cout < <"new " < <endl;}
};
void main(){
vector <TT> v(10);
}
报错:microsoft visual studio\vc98\include\vector(41) : error C2512: 'TT::TT' : no appropriate default constructor available
WHY??