Advertisement
Guest User

Untitled

a guest
Sep 21st, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.06 KB | None | 0 0
  1. #include "buchung.h"
  2.  
  3. #include "string.h"
  4.  
  5. #include <iostream>
  6. using namespace std;
  7.  
  8. Buchung::Buchung()
  9. {
  10.     this->verwendungszweck = NULL;
  11. }
  12.  
  13. Buchung::~Buchung()
  14. {
  15.     delete(this->verwendungszweck);
  16. }
  17.  
  18. Buchung::Buchung(float newBetrag, char * newVerwendungszweck)
  19. {
  20.     this->betrag = newBetrag;
  21.     this->verwendungszweck = newVerwendungszweck;
  22. }
  23.  
  24. Buchung::Buchung(const Buchung & other)
  25. {
  26.     ;
  27. }
  28.  
  29. Buchung Buchung::operator=(const Buchung & other)
  30. {
  31.     ;
  32. }
  33.  
  34. void Buchung::info()
  35. {
  36.     cout << "\t\tBuchung:" << endl;
  37.     cout << "\t\tBetrag:\t\t" << this->betrag << endl;
  38.     cout << "\t\tVerwendugnszweck:\t" << this->verwendungszweck << endl;
  39. }
  40.  
  41. void Buchung::setBetrag(float newBetrag)
  42. {
  43.     this->betrag = newBetrag;
  44. }
  45.  
  46. float Buchung::getBetrag()
  47. {
  48.     return this->betrag;
  49. }
  50.  
  51. void Buchung::setVerwendungszweck(char * neu)
  52. {
  53.     if (neu != NULL)
  54.     {
  55.         delete(verwendungszweck);
  56.         verwendungszweck = strdup(neu);
  57.     }
  58. }
  59.  
  60. char * Buchung::getVerwendungszweck()
  61. {
  62.     return this->verwendungszweck;
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement