Template Objects.

Guys i have template class and want to allocate memory dynamically for it.

currentAffairs<string> *objForCAffairs;

and then:
1
2
3
4
5
6
7
cin>>(*sizeG);
    objForCAffairs=new currentAffairs[(*sizeG)];
    for(int i=0;i<(*sizeG);i++){//Taking the Details of apps to store of each   //oBject
    cout<<"Enter App No: "<<i+1<<endl<<endl;
    objForCAffairs[i].setvalue();
    }
    

It is giving the error that currentAffair is not a type what should i do?
There are template arguments in this statement

objForCAffairs=new currentAffairs[(*sizeG)];
I do not understand, it has no argument of template.
objForCAffairs is not a currentAffairs. It's a currentAffairs<string>.

Topic archived. No new replies allowed.