Results 1 to 6 of 6

Thread: How can I implement the remove() in CPP

  1. #1
    Join Date
    Dec 2009
    Posts
    23

    How can I implement the remove() in CPP

    Hi, I am the student of the Msc-CS. I have to submit the assignment on the functions of the CPP language that can be in-built in the CPP library in five days. I could had the good knowledge of the functions that could be used in the CPP language. Even if, I could not know much more about the remove() function of the CPP language. So, I would like to know about the remove() function of the CPP language. I also would like to know how can I implement the remove() function in the CPP programming. Reply Me!!

  2. #2
    Join Date
    Apr 2008
    Posts
    1,948

    Implement the remove()

    The remove() function can be used in the CPP language to remove the value of the given an element from the given specified range. the following can be the general syntax of the remove() function in the CPP language :
    Code:
    template < class FrwrdItrtr, class S >
      FrwrdItrtr remove ( FrwrdItrtr fst, FrwrdItrtr lst,
                               const S& val );

  3. #3
    Join Date
    May 2008
    Posts
    2,012

    The remove() in CPP

    Hello, According to me the remove() function can be used in the CPP language to remove all of an elements that can be matching to the specified given value in the the range. The behavior of the remove() function template can be similar to the following as :
    Code:
    template < class FrwrdItrtr, class S >
      FrwrdItrtr remove ( FrwrdItrtr fst, FrwrdItrtr lst, const S& val )
    {
      FrwrdItrtr rslt = fst;
      for ( ; fst != lst; ++fst)
        if (!(*fst == val)) *rslt++ = *fst;
      return rslt;
    }

  4. #4
    Join Date
    Apr 2008
    Posts
    2,005

    Implement the remove() in CPP

    The following sample program could helps you to learn more about the remove() function and how could you able to implement the remove() function in the CPP program :
    Code:
    #include <cstdio>
    using namespace std;
    int main()
    {
      if ( !remove("usles.txt") )
      {
          cout<<"Deletion of file can be successful";
      }
      else
      {
          cout<<"file can not be deleted (is it there?)";
      }
    }

  5. #5
    Join Date
    May 2008
    Posts
    2,297

    remove() in CPP

    The following can be the parameters of the remove() function in the CPP language :
    1. val : This parameter can be used in the CPP language for the Value that can be removed from the given range.
    2. fst, lst : These parameters can be used in the CPP language for the forward iterators to the final and starting positions in a given specified sequence. The range used can be [fst,lst).

  6. #6
    Join Date
    Nov 2005
    Posts
    1,323

    The remove()

    In the CPP language, To Remove from the given specified range an elements with a value that can be equal to the value and that can returns an iterator to the newer end of the given range which now can includes only the values that can not be equal to value. The remove() function can returns the forward iterator that can be pointing to the newer end of the given sequence which can now includes all the elements with a value other than value.

Similar Threads

  1. How to implement Altiris 7.1 CMS
    By Mystic01 in forum Networking & Security
    Replies: 4
    Last Post: 29-05-2011, 10:48 PM
  2. Implement the set_intersection() in C++
    By Agustíne in forum Software Development
    Replies: 5
    Last Post: 04-03-2010, 06:24 PM
  3. How to implement IP Sec
    By Enriquee in forum Technology & Internet
    Replies: 5
    Last Post: 12-01-2010, 06:28 AM
  4. How to implement Web conferencing
    By Balamohan in forum Technology & Internet
    Replies: 5
    Last Post: 20-12-2009, 05:14 AM
  5. Implement Java tic tac toe
    By SmokiN in forum Software Development
    Replies: 3
    Last Post: 29-06-2009, 09:09 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,115,350.69473 seconds with 17 queries