是这样吗,试试看:
#include
using namespace std;
template
class Point
{
public:
Point(numtype a,numtype b=0);
void print();
private:
numtype x,y;
};
template
Point
{
x=a;
y=b;
}
template
void Point
{
cout<
int main()
{
Point
p.print();
return 0;
}
是这样吗,试试看:
#include
using
namespace
std;
template
class
Point
{
public:
Point(numtype
a,numtype
b=0);
void
print();
private:
numtype
x,y;
};
template
Point
a,numtype
b)
{
x=a;
y=b;
}
template
void
Point
{
cout<
int
main()
{
Point
p(2);
p.print();
return
0;
}
template
{
cout<