C++ 静态常量

#include<iostream>
#include<stdexcept>
#include <map>

using namespace std;


class node
{
public:
    static int a;
};

int node::a=10;


int main()
{

    cout<<node::a;

}

class node
{
public:
    static const int a;
};

const int node::a=10;

int main()
{
    cout<<node::a;
}

 

posted on 2015-11-20 15:56  zyz913614263  阅读(1134)  评论(0编辑  收藏  举报

导航