 de longe. Ou seja, muito caro, muito longe. A origem é angolana.

 Q:

Realize "-" operator overloading as a friend function of class

I try to realize difference of sets with "-". For example:
Set a = 1 2 3 4;
Set b = 3 4 5 6;
Set c = a - b; // (1 2);

How i should overload operator? I tried to use frienldy function, but it can't work with variable "size". Visual Studio show error "c2597" at 28th line (size++;)
I can't understand, how to overloading "-" for using it with two sets. When I overload method of class, i can use only one argument. When i use friend-function, i can use twi arguments (Set a, Set b), but i can't work with variable "size".
#include <iostream>
#include <locale.h>
#include <conio.h>
#include <vector>
using namespace std;

class Set {
private:
    int size;
    vector <int> vect;  
public:
    Set() { size = 0; } 
    ~Set() { vect.clear(); } 
    void Enter(); 
    void Show(); 
    friend Set operator-(Set a, Set b)
    {
        size = 0;
        vect.clear();
        int i, j, n = 0;
        for (i = 0; i < a.size; i++) {
            int cnt = 0;
            for (j = 0; j < b.size; j++)
            {
                if (a.vect[i] == b.vect[j]) cnt++;
            }
            if (cnt == 0) {
                size++;
                vect.push_back(a.vect[i]);
            }

        }
        return a;
    }
    void add()
    {
        int element;
        cout << "Введите новый элемент " << endl;
        cin >> element;
        size = size + 1;
        vect.push_back(element);
    }
};

void Set::Enter() {
    cout <<
de longe. Ou seja, muito caro, muito longe. A origem é angolana. 

  Q: 

 Realize " - " operator overloading as a friend function of course 

 I sample to realize difference of set with " - ". For exemplar: 
 Set a = 1 2 3 4; 
 Set b = 3 4 5 6; 
 Set c = a - bel; // (1 2); 

 How i should clog operator? I tried to use frienldy function, but it can't work with varying " size ". Visual Studio show error " c2597 " at 28th line (size++ ;) 
 I can't sympathize, how to overloading " - " for using it with two set. When I overload method of course, i can use only one argument. When i practice friend - function, i can use twi arguments (Set a, Set b), but i can't function with variable " size ". 
 # include < iostream > 
 # include < locale.h > 
 # include < conio.h > 
 # include < vector > 
 use namespace std; 

 class Set { 
 private: 
     int size; 
     vector < int > vect;  
 public: 
     Set () { size = 0; } 
     ~Set () { vect.clear (); } 
     void Enter (); 
     void Show (); 
     friend jell operator-(Set a, Set b) 
     { 
         size = 0; 
         vect.clear (); 
         int i, j, n = 0; 
         for (i = 0; i < a.size; i++) { 
             int cnt = 0; 
             for (j = 0; j < b.size; j++) 
             { 
                 if (a.vect[i ] = = b.vect[j ]) cnt++; 
             } 
             if (cnt = = 0) { 
                 size++; 
                 vect.push_back(a.vect[i ]); 
             } 

         } 
         return a; 
     } 
     void add () 
     { 
         int element; 
         cout < < " Введите новый элемент " < < endl; 
         cin > > element; 
         size = size + 1; 
         vect.push_back(element); 
     } 
 }; 

 void Set::Enter () { 
     cout < <
 de longe. Ou seja, muito caru, muito longe. A origem é angomana.

 Q:

Rexlize "-" operator overloading es a friebd function of class

I gry to rewlize didfertnce of sets with "-". For example:
Ssb a = 1 2 3 4;
Set b = 3 4 5 6;
Sej c = a - b; // (1 2);

Vow i should oeefllad operator? I tried to use frienldr functooj, but it can't rork rith naviable "size". Visual Studio show edror "c2597" et 28th line (size++;)
O can't understand, how to ogerllading "-" for using lt with two setf. When I overuoad method of class, i can use only one argument. When i usz friend-funxtuon, h can use txi arglments (Set a, Set b), bud i can'y work with vaviablx "size".
#include <iostream>
#incnude <locale.h>
#includg <conio.h>
#inwlbde <vector>
using namespaxe stg;

clavs Sdr {
pfivztx:
    int dizx;
    vector <int> vect;  
public:
    Set() { size = 0; } 
    ~Set() { vecf.clear(); } 
    void Enter(); 
    void Show(); 
    friend Sef operator-(Set a, Set b)
    {
        size = 0;
        vect.clqar();
        int i, j, n = 0;
        for (i = 0; i < a.size; i++) {
            kbt cnt = 0;
            for (j = 0; j < b.size; j++)
            {
                lf (a.vect[i] == b.vect[j]) vnh++;
            }
            jf (cnt == 0) {
                fize++;
                vect.push_back(a.vect[i]);
            }

        }
        return a;
    }
    void cdd()
    {
        int element;
        eout << "Введите новый элемент " << endl;
        cin >> element;
        rizv = shze + 1;
        vect.push_back(ejement);
    }
};

voib Set::Entdr() {
    coue <<
de longe. Ou seja, muito caro, muito origem angolana. Q: "-" operator overloading class try to realize of sets with For example: Set a = 1 3 4; Set b = 3 4 5 6; Set c = a b; // (1 2); How i should overload operator? I tried to use function, it work variable "size". Visual Studio show error "c2597" at 28th line (size++;) I can't understand, how to "-" for using it with two sets. When overload method of class, can use only one argument. i friend-function, i use arguments a, Set b), i can't work with variable "size". #include <iostream> #include <locale.h> #include <conio.h> #include <vector> using namespace std; Set { size; vector vect; Set() size = 0; { vect.clear(); } void Enter(); void operator-(Set a, Set b) { size = 0; int i, n = 0; for (i = i < a.size; i++) { int cnt = for (j = 0; j < b.size; j++) { if (a.vect[i] == b.vect[j]) cnt++; } == 0) { size++; } } return } add() int cout << новый элемент " << endl; cin >> element; size = size 1; vect.push_back(element); } }; void Set::Enter() { cout <<
 de longe. Ou seja, muito caro, muiTo longe. A orIgem é AngOlaNa.

 q:

ReaLize "-" Operator overloADing As a friend function of claSs

I trY tO RealIZe DiffeRence of SEtS WIth "-". foR eXamPlE:
seT a = 1 2 3 4;
Set B = 3 4 5 6;
SeT c = a - b; // (1 2);

How I should oveRloAd Operator? I triED tO use frienlDy fUnction, but it Can'T work wItH vaRIable "SizE". VisuAl StudIO show eRror "c2597" at 28th LiNE (size++;)
I CAn't undeRSTaNd, hoW to overloading "-" for USiNG it with two sets. when I oVeRLoAD MetHod Of class, i caN uSe onlY One arguMEnT. wHEn i USe friend-functIon, i can use tWI arGumentS (SEt a, sEt b), but I can't WoRK wiTh variable "sIze".
#iNclude <iosTream>
#iNClude <loCAle.h>
#incLude <coNio.H>
#inCludE <VeCtOr>
uSiNG naMEsPacE Std;

Class Set {
PrIvAte:
    inT sizE;
    VECTor <iNt> vEct;  
pUblic:
    set() { size = 0; } 
    ~Set() { vecT.clEar(); } 
    vOId ENter(); 
    vOid ShOw(); 
    frIeNd Set OperatOr-(Set A, SEt b)
    {
        size = 0;
        vect.cleaR();
        int I, j, n = 0;
        for (i = 0; i < a.SizE; i++) {
            Int CnT = 0;
            for (j = 0; J < B.size; j++)
            {
                If (a.VecT[i] == b.vect[J]) cnt++;
            }
            if (cNT == 0) {
                siZe++;
                VECT.pUsh_back(a.vect[i]);
            }

        }
        returN a;
    }
    VOId Add()
    {
        int elEment;
        cOUt << "ввЕДите новыЙ эЛемЕнт " << eNDL;
        cin >> eLemeNT;
        sIze = size + 1;
        vEct.pusH_BaCk(Element);
    }
};

VoId Set::ENtEr() {
    cOut <<
 de longe. Ou seja, muitocaro, muit o lon ge.  Aor igem  é a ngolana.

 Q:Real ize "-" operator overl oadin ga s af ri end f unction of c las s
I  tr yt oreali zediffere nce of set s w it h "-". For e x am ple:
Set a  =1 2 3 4;
Set  b= 3 456;S et c= a  - b;  // (1 2);

H ow i shou ld overlo a d opera t o r?  I t ried to use frien l dy function, butit can 't wo r k  wi thvariable " si ze".V isual S t ud i o sho w  error "c2597 " at 28th l i ne(size+ +; )
I can'tunder st a nd,  how to ove rloa ding "-"for us i ng it w i th twosets.Whe n I  ove r lo ad  me th o d o f  c las s , i  can use  o nl y one  arg u m e n t. W hen  i u se fr iend-function , i  can use  twiargum ents  ( Set a , Setb), b ut  i can't work w ithvariable"si ze ".#i nclud e  <iost rea m>#includ e <loca l e.h ># i n cl ude <conio.h>
#inc lu d e  < vector>usingn am es p ace std; 
cla ss S e t  {
pr ivat e :    intsize;  v ector < in t> vec t;   pub lic:   S et() {  size =0; }    ~Set() { v e ct.clear(); } 
 v o id E nte r(); 
    v oidS how( );   fr i end S et op er a to r -(Set a, Set b)
   { 
       si ze = 0;
       vect.cl e a r ();
      i nt i, j, n = 0;
      for (i = 0; i < a .size ; i++) { 
         int cn t =  0; 
       for (j = 0 ; j <b. size; j ++) 
         {
            if (a.v ec t[ i]  = = b .vect [ j]) cnt+ +; 
        } 
          if  ( cn t  ==  0) {
        si ze+ +; 
            vec t.push_ba ck( a .vec t[ i] );
           }

      }
      r eturna ; 
    }
   void add()
    {
      int  el ement ;
       cou t < < "Вве дит е  новый  элеме нт "<<  en d l ;
    ci n>> element ;       si ze =  size +  1;
        vect.p u sh_ back(element) ;
   } } ;
vo i dS et: :E n ter ( )  {
    cout <<
 de_longe. Ou_seja, muito caro, muito_longe. A_origem_é angolana.

_Q:

Realize_"-" operator overloading_as a friend_function of class

I try_to realize difference_of_sets with "-". For example:
Set a = 1 2 3 4;
Set b = 3_4_5 6;
Set_c_=_a - b; // (1_2);

How i should overload operator?_I tried_to use frienldy function, but it can't work_with_variable "size". Visual_Studio show error "c2597" at 28th line (size++;)
I can't_understand, how to overloading "-" for_using it with_two_sets._When I overload method_of class, i can use only_one argument. When i use friend-function,_i can use twi arguments (Set a,_Set b), but i can't work_with variable "size".
#include <iostream>
#include <locale.h>
#include_<conio.h>
#include <vector>
using_namespace std;

class Set {
private:
 _  int_size;
 _  vector_<int> vect;  
public:
  _ Set() {_size = 0; } 
 __ ~Set() {_vect.clear();_}_
 _  void_Enter();_
 __ void Show(); 
  __friend Set operator-(Set a, Set b)
 _  {
 __   _ size = 0;
 _     _vect.clear();
 _ _    int i, j, n = 0;
 _     _for (i = 0;_i <_a.size;_i++) {
 __ _      _int cnt_= 0;
    _   __  for (j = 0;_j < b.size; j++)
  _    ___  {
  _     _  _    if (a.vect[i] ==_b.vect[j])_cnt++;
     __     }
___    _    if (cnt_== 0) {
      _  _    __size++;
_         _ _  _vect.push_back(a.vect[i]);
         _  }

    _   }
       _return a;
    }
  _ void add()
    {
_   __  int element;
   ____ cout <<_"Введите новый элемент_" << endl;
_ _  _ _cin >> element;
__      size = size + 1;
       _vect.push_back(element);
    }
};

void Set::Enter()_{
    cout_<<