+ -
当前位置:首页 → 问答吧 → 如何将安装在usr/bin下面的程序安装到usr/local/bin下面

如何将安装在usr/bin下面的程序安装到usr/local/bin下面

时间:2011-11-10

来源:互联网

代码:
#include<iostream>
using namespace std;
template<class T>
int total(T &t)
{
   return t.blance;
}
class CBank
{
public:
   CBank(int b=0)
   {
      blance=b;
   }
   friend int total(CBank &t);
private:
   int blance;
};
class BBank
{
public:
   BBank(int b=0)
   {
      blance=b;
   }
   friend int total(BBank &t);
private:
   int blance;
};
class GBank
{
public:
   GBank(int b=0)
   {
      blance=b;
   }
   friend int total(GBank &t);
private:
   int blance;
};
int main()
{
   int tol=0;
   CBank a1(20);
   BBank a2(40);
   GBank a3(50);
   tol=total(a1)+total(a2)+total(a3);
   cout<<"The total is "<<tol<<endl;
   return 0;
}
一个有问题的小程序,请大家指教了!(把有元函数声明里的T改为具体的类也没能通过。)

作者: fireandice   发布时间: 2011-11-10