修改后的代码如下:# include # include using namespace std ;class Zhongguohaoshengyin{ public : // 原先public写错了,构造函数激兆此猜基没有问题 Zhongguohaoshengyin (string = "aa" , string = "bb" , string = "cc") ; void show_pingwei () ;string name_1 ; string name_2 ; string name_3 ;} ;void Zhongguohaoshengyin :: show_pingwei (){ cout << "第一位评委是 "<< name_1 << endl ; cout << "第二位评委是 " << name_2 << endl ; cout << "第三位评委是 " <明迅< name_3 << endl ;}Zhongguohaoshengyin :: Zhongguohaoshengyin (string n_1 , string n_2 , string n_3 ){ name_1 = n_1 ; name_2 = n_2 ; name_3 = n_3 ;}int main (){ Zhongguohaoshengyin haoshengyin ; haoshengyin.show_pingwei () ; // 函数原先写成show_pintwei()了。 return 0 ;}
版权声明:文章由 百问九 整理收集,来源于互联网或者用户投稿,如有侵权,请联系我们,我们会立即处理。如转载请保留本文链接:https://www.baiwen9.com/tips/261336.html