CSDN博客

img shaidanR

静态类成员的指针

发表于2004/11/4 9:38:00  734人阅读

分类: C++

#include <iostream>

using namespace std;

class Account
{
private :
     static double _interestRate;
     double _amount ;
     string _owner;
public :
     static void raiseInterest( double incr );
     static double interest()
     {
          return _interestRate ;
     }
     double amount ()
     {
          return _amount;
     }
};

double Account::_interestRate;

inline void Account::raiseInterest( double incr )
{
     _interestRate +=incr ;
}

void main()
{
     double (*Ptr_temp)() = &Account::interest;
}

阅读全文
0 0

相关文章推荐

img
取 消
img