帮我改一下错好吗?C++语言语法问题。。
程序代码:
#include <iostream> #include <string.h> using namespace std; class books { private: char author[10]; float price; public: books(char *au, float pri) { strcpy(author, au); price = pri; } void showprice() { cout << price <<endl; } }; class m:private books { private: int id; public: m(char *au, float pri) { books(char *au, float pri); } void setid(int x) { id = x; } void showid() { cout << id << endl; } }; int main() { m abc("Yes", 2.5); abc.setid(10); // abc.showprice(); abc.showid(); return 0; }