Is it possible that I give the template a type according to user choice, and then call the functions of that object???? if yes then please tell me how...
int main()
{
int choice;
w: cout<<"What type of DATA do you want to store in list?"<<endl;
cout<<"press 1 for char \npress 2 for int \npress 3 for float"<<endl;
choice=getch();
if(choice==49)
{dllist<char> obj;}
elseif(choice==50)
{dllist<int> obj;}
elseif(choice==51)
{dllist<float> obj;}
else
{ system("CLS");
cout<<"wrong selection! TRY AGAIN..."<<endl;
goto w;
}
system("CLS");
x: cout<<"press 1 to count nodes\npress 2 to display List\npress 3 for other operations"<<endl;
choice=getch();
if(choice==49)
{obj.countnode();}
elseif(choice==50)
{obj.display();}
elseif(choice==51)
{dllist<float> obj;}
else
{ system("CLS");
cout<<"wrong selection! TRY AGAIN..."<<endl;
goto x;}