模板函数:
template <class T>
T func(T t1)
{
return t1;
}
模板类:
template <class T>
class CA
{
public:
T func(T t1);
}
template <class T>
T CA<T>::func(T t1)
{
return t1;
}
模板函数:
template <class T>
T func(T t1)
{
return t1;
}
模板类:
template <class T>
class CA
{
public:
T func(T t1);
}
template <class T>
T CA<T>::func(T t1)
{
return t1;
}
in stack: int a;
in heap: int* pa = new int;
global: int a; (not in a function)
local static: static int a;
近期评论