All pastes #594357 Raw Edit

Someone

public text v1 · immutable
#594357 ·published 2007-06-28 22:00 UTC
rendered paste body
person &operator~() //Doppelte Telefonnummern beseitigen
       {          
           for(int i=0; i<getat(); i++)
           {
               for(int k=0; k<getat(); k++)
               {
                   if(strcmp(this->tel[i], this->tel[k])==0)
                   {
                       if(k==i)
                          continue;
                       if(k+1>=getat())
                       {
                           this->tel[k]=0; // danach
                           this->at--;     // gehts nit mehr
                       }
                       else
                       {
                           this->tel[k]=new char[strlen(this->tel[k+1])+1];
                           strcpy(this->tel[k], this->tel[k+1]);
                           this->tel[k+1]=0;
                           this->at--;
                       }
                          
                       cout<<this->tel[k]<<" doppelt"<<endl;
                       cout<<"bla";
                   }
               }
           }
       }