Advertisement
Ghosty_

Untitled

Jan 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.17 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. class Kello {
  5.     public:
  6.         Kello(int minuutti);
  7.         void tulosta() const;
  8.         int hae_minuutti() const;
  9.         int plus(aika2*);
  10.     private:
  11.         int minuutit_;
  12.  
  13. };
  14. Kello::Kello(int minuutti): minuutit_(minuutti) {
  15. }
  16.  
  17. void Kello::tulosta() const {
  18.     cout << hae_minuutti() << endl;
  19. }
  20. int Kello::hae_minuutti() const {
  21.     return minuutit_;
  22. }
  23. int Kello::plus(aika2*) {
  24.     cout << minuutit_+aika2.hae_minuutti() << endl;
  25. }
  26.  
  27. int main() {
  28.     Kello aika1(01);
  29.     Kello aika2(05);
  30.     aika1.tulosta();
  31. }
  32.  
  33. testiä.cpp:9:18: error: ‘aika2’ has not been declared
  34.          int plus(aika2*);
  35.                   ^
  36. testiä.cpp:23:17: error:int Kello::plus’ is not a static data member of ‘class Kello’
  37.  int Kello::plus(aika2*) {
  38.                  ^
  39. testiä.cpp:23:17: error: ‘aika2’ was not declared in this scope
  40. testiä.cpp:23:23: error: expected primary-expression before ‘)’ token
  41.  int Kello::plus(aika2*) {
  42.                        ^
  43. testiä.cpp:23:25: error: expected ‘,’ or ‘;’ before ‘{’ token
  44.  int Kello::plus(aika2*) {
  45.                          ^
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement