64,682
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <string>
using namespace std;
// 内模板定义
template <class color, class high>
class Box{
public:
color m_c;
high m_h;
Box(color c, high h)
{
m_c = c;
m_h = h;
}
void ShowBox()
{
cout << "m_c = " << m_c << ",m_h = " << m_h << endl;
}
};
int main()
{
Box<string, int > *b2 = new Box("yellow",66);
return 0;
}