Advertisement
Guest User

lettera.cpp

a guest
Jan 31st, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.87 KB | None | 0 0
  1. #include "Lettera.h"
  2.  
  3. Lettera::Lettera(const int C, const char * A, const int N, const char * F, const char * M, const char * D)
  4. :Manoscritto(C,A,N,F) {
  5.                       Mittente=new char[strlen(M)+1];
  6.                       Destinatario=new char[strlen(D)+1];
  7.                       strcpy(Mittente, M);
  8.                       strcpy(Destinatario, D);
  9. }
  10.  
  11. Lettera::Lettera(const Lettera & L) : Manoscritto(L) {
  12.                       Mittente=new char[strlen(L.Mittente)+1];
  13.                       Destinatario=new char[strlen(L.Destinatario)+1];
  14.                       strcpy(Mittente, L.Mittente);
  15.                       strcpy(Destinatario, L.Destinatario);
  16. }
  17.  
  18. void Lettera::visualizza_dati() const {
  19.   cout << Mittente << " " << Destinatario << endl;  
  20. }
  21.  
  22. void Lettera::memorizza_dati(){
  23.   cout << "Inserisci i dati: \n";
  24.   cin >> Mittente >> Destinatario;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement