03supraincarcarea Operatori

  • Uploaded by: Patrick Johnston
  • 0
  • 0
  • July 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View 03supraincarcarea Operatori as PDF for free.

More details

  • Words: 204
  • Pages: 1
Supraîncărcarea operatorilor #include #include<string.h> class SIR { char *text; //membru privat (singurul) public: SIR(char *sir); //definitia constructorului ~SIR( ) //definitia destructorului { delete text; } int compar(SIR &s1, SIR &s2); //fct. cu 2 param. de tip referinta la sir tipul SIR? int compar(SIR &s1, SIR &s2, int n); //supraincarcarea functiei compar void operator || (SIR &s) //supraincarcarea operatorului "||" { strcat(text, s.text); } void afisare( ) //un obiect de tip SIR nu are acces la un un membru privat decat { //printr-un membru(functie) publica cout<

Related Documents


More Documents from ""