title: How can i add a static vector to a class
body: <p>I have a class and i want a vector to live for the the life of the  programe so i am using a static vector.</p>
  
  <p>Please look at my code and advise me if their is better way of using static variable.</p>
  
  <pre><code>static std::vector&lt;std::string&gt; Stack;
  
  
  class Test
  {
  
  
  public:
  void AddStack(std::string str)
  void PopStack()
  
  };
  
  
  void Test::AddStack(std::string str)
  {
  
  Stack.insert(Stack.end(),str.begin(),str.end());
  
  }
  
  
  void Test::PopStack()
  {
  
     if(!Stack.empty() )
      {
        Stack.pop_back();
  
      } 
  
  }
  </code></pre>