Answers for "std::list insert"

0

std::list insert

//3.1 Create list and iterator
list<int> theList;
Add_ListElements(theList);
Print_List(theList);
//3.2 Position the Iterator for Insertion
list<int>::iterator Position;
Position = theList.begin();
Position++;
Position++;
//3.3 Insert an element and print the list
printf("\nAfter inserting the Single Element,");
Position = theList.insert(Position, 7);
Print_List(theList);
Posted by: Guest on October-13-2021

Browse Popular Code Answers by Language