求指点迷津.
#include<iostream.h>template<class T1,class T2>
class myclass{
public:
myclass(T1 a,T2 b)
{i=a;j=b;}
void show()
{cout<<i<<' '<<j<<'\n';
}
private:
T1 i;
T2 j;
};
int main()
{ myclass <int,double>ob1(10,0.23);
myclass<char,char*>ob2('X',"this is a test.");
ob1.show();
ob2.show();
return 0;
}