通过海量题库、编程比赛和实时排名,系统化提升您的编程能力。
有如下定义,上述程序段中,错误的语句是()。
cpp class Sample{ public: Sample(int x): ref(x) {} //① private: Sample():ref(0) {} //② static int val=5; //③ const int ref; //④ };