Link to home
Start Free TrialLog in
Avatar of meow00
meow00

asked on

pop an element

Hi C++ experts,

   I have a code as follows :
-------------------------------------
typedef std::vector<std::string> V ;
typedef std::vector<V> W ;

void insert(W& c, V& item)
{ c.push_back(V()) ; }

int main()
{
  W w1;
  V v1, v2 ;
  v1.push_back("Hello") ;
  v1.push_back("World") ;

  v2.push_back("Doggy_1") ;
  v2.push_back("Doggy_2") ;
  v2.push_back("Doggy_3") ;

  insert(w1,v1) ;
  insert(w1,v2) ;

  return 0 ;
}
-------------------------------------------
  After the data are inserted into w1, I don't know how to pop out
 v1 and v2 ! I don't know how to pop out the element such as "Hello","World", "Doggy_1" ...etc. Could anyone give me some help please ?

  Thanks.

meow.
ASKER CERTIFIED SOLUTION
Avatar of tinchos
tinchos

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial