Thread: Vectro clear function

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Nov 2019
    Posts
    50

    Vectro clear function

    Hi guys, Im using library of STL called #include <vector>
    when I have a vector like this:
    Code:
     vector<int> v
    I do push_back(10) 10times, then I do v.clear() then if I do v.size() then it will return zero... what's confusing is how PC can know that we have cleared the vector and it's size is zero?! because it's really complicated to imagine it.. could anyone help me how can PC clear the values of vector and update that the size of vector is zero?!

    what's confusing me that Im not accepting that idea in freshy way that PC can after cleaning the vector will return zero .. it's like human thinking but how does he do that? really weird .. is it maybe system call to do clear for data?!
    Last edited by Brian_Teir; 12-09-2019 at 12:59 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Clear screen function
    By Brolaf Broski in forum C Programming
    Replies: 10
    Last Post: 11-13-2013, 04:02 PM
  2. A function to Clear String.
    By sergioms in forum C Programming
    Replies: 4
    Last Post: 11-22-2008, 01:02 PM
  3. clear screen function
    By mrprogrmr in forum C Programming
    Replies: 16
    Last Post: 12-28-2004, 10:49 AM
  4. clear screen function
    By monkeymon in forum C Programming
    Replies: 6
    Last Post: 10-05-2002, 12:23 PM
  5. Is there any clear function?
    By lockpatrick in forum C Programming
    Replies: 9
    Last Post: 03-27-2002, 09:07 AM

Tags for this Thread