|
今天开始学c++中的类了
但是第一个程序就被g++给出了一大堆错误,错误如下
1.cc:14: semicolon missing after declaration of `clock'
1.cc:15: ISO C++ forbids defining types within return type
1.cc:15: two or more data types in declaration of `settime'
1.cc:15: prototype for `clock clock::settime(int, int, int)' does not match any
in class `clock'
1.cc:8: candidate is: void clock::settime(int = 0, int = 0, int = 0)
1.cc:15: `clock clock::settime(int, int, int)' and `void clock::settime(int =
0, int = 0, int = 0)' cannot be overloaded
1.cc:15: semicolon missing after declaration of `class clock'
1.cc: In member function `int clock::settime(clock*, int, int, int)':
1.cc:17: `mimute' undeclared (first use this function)
1.cc:17: (Each undeclared identifier is reported only once for each function it
appears in.)
1.cc: In function `int main()':
1.cc:28: `clock' undeclared (first use this function)
1.cc:28: parse error before `;' token
1.cc:30: `myclock' undeclared (first use this function)
明明是一开始就定义了的类,后面却说没有定义的类
请问这是为什么? |
|