Static members variables can be used only in static methods of class, but why we can assign value to static variable inside constructor of C++ class?

后端 未结 0 500
臣服心动
臣服心动 2021-01-20 17:19
#include 
using namespace std;
 
class Player
{
private:
    static int next_id;
public:
    static int getID() { return next_id; }
    Player(int x)         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题