Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iomanip>
- using namespace std;
- class Kello {
- public:
- Kello(int minuutti);
- void tulosta() const;
- int hae_minuutti() const;
- int plus(aika2*);
- private:
- int minuutit_;
- };
- Kello::Kello(int minuutti): minuutit_(minuutti) {
- }
- void Kello::tulosta() const {
- cout << hae_minuutti() << endl;
- }
- int Kello::hae_minuutti() const {
- return minuutit_;
- }
- int Kello::plus(aika2*) {
- cout << minuutit_+aika2.hae_minuutti() << endl;
- }
- int main() {
- Kello aika1(01);
- Kello aika2(05);
- aika1.tulosta();
- }
- testiä.cpp:9:18: error: ‘aika2’ has not been declared
- int plus(aika2*);
- ^
- testiä.cpp:23:17: error: ‘int Kello::plus’ is not a static data member of ‘class Kello’
- int Kello::plus(aika2*) {
- ^
- testiä.cpp:23:17: error: ‘aika2’ was not declared in this scope
- testiä.cpp:23:23: error: expected primary-expression before ‘)’ token
- int Kello::plus(aika2*) {
- ^
- testiä.cpp:23:25: error: expected ‘,’ or ‘;’ before ‘{’ token
- int Kello::plus(aika2*) {
- ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement