Hi..
My code is as follows :-
class Class1
{
};
class class2
{
};
main()
{
....
.....
if(var==true)
class1 c1=createandmanipulate(file);
else
class2 c1=createandmanipulate(file);
......
.....
.....
}
How should i declare the createandmanipulate() function so that it can return the respective object i.e either of Class1 or Class2 depending on the value of variable "var"at runtime. Also i know it can be done using template but how. ?? I have no idea.. Plz help