关于类的,帮忙看下哪错了.
程序代码:
#include<iostream> using namespace std; class Human() { int c1; public: Human(int num) { c1=num; } void print() { cout<<c1<<endl; } }; int main() { Human a(40); a.print(); return 0; }
#include<iostream> using namespace std; class Human() { int c1; public: Human(int num) { c1=num; } void print() { cout<<c1<<endl; } }; int main() { Human a(40); a.print(); return 0; }