I've got this:
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <sstream>
using namespace std;
class alfa{
private:
int x;
public:
alfa(){
cout<<"Dimiourgithike ena alfa"<<endl;
x=rand()%10;
}
~alfa(){
cout<<"Katastrafike ena alfa"<<endl;
}
void get_x(){
cout<<"To x exei timi: "<<x<<endl;
}
};
int main(){
alfa* alfadi;
int no;
cout<<"Dose enan arithmo"<<endl;
cin>>no;
vector<alfa> alfadia;
for(int i=0;i<no;i++){
alfadi=new alfa;
alfadia.push_back(alfadi);
}
}
But i get error on push_back() while compiling.Any ideas?