SlideShare a Scribd company logo
1 of 17
Download to read offline
Level up your coding skills with
the C++ Standard Template
Library (STL):
List
BY JOYJIT CHOUDHURY
List
 List is a sequence container that allows constant time
insertion and deletions anywhere in the container
 It allows iterations in both directions
 Fast random access is not supported
 List containers are implemented as Doubly Linked List
 Defined in the header <list>
 Belongs to the namespace std
Construction of a list
Accessing the elements
 Member functions front() and back(), returns a
reference to the first and last element of the list,
respectively
front() back()
Accessing the elements
 front() and back() return a reference, so not only can
you view the first and last element, you can also modify
them
list<int> mylist
Insert elements
 Member functions push_front() and push_back(), inserts an element
to the beginning and the end of the list, respectively
Delete elements
 Member functions pop_front() and pop_back(), removes the first
and the last element of the list, respectively
Size of the list
 Member function size() returns the number of elements in the list
 Time Complexity : O(n)
Is the list empty?
 Member function empty() returns true if the list is empty (i.e. list size is 0),
else returns false
 Time Complexity : O(1)
 It’s a preferred way to check
whether a list is empty,
instead of checking whether
the size of the list is 0, since
this takes constant time
So, how do you Traverse a list?
 The thing about containers is, you hardly know anything about it’s internal
mechanisms
 All the internal details regarding :
 How the memory is allocated
 Where and how the data elements are stored
 How the insertion, access and removal of individual elements take place
It’s all kept hidden from the user.
 So, what if you had to access the individual elements, maybe even modify
them?
 For that purpose, containers have what is known as Iterators
What are Iterators?
 An iterator is an object, pointing to some element in a range of
elements (usually, a container), which has the ability to iterate through
the elements in that range through a set of operators
(increment (++) operator, dereference (*) operator, etc)
 You can think of them as an abstraction of pointers
 What that means is, they are like pointers in certain ways, but not
exactly
Iterators
 The best way to understand iterators, would be through an example
list<int> myList
myList.begin()
Iterators
list<int> myList
myList.begin() myList.end()
Insert elements anywhere in the list
 Member function insert(), inserts new elements before the element at
the specified position. The position is specified by passing an iterator as a
parameter.
Delete elements from anywhere
 Member function erase(), removes from the list, either a single element from
the specified position, or all the elements in the specified range [first, last).
 That’s not all. There are many other functions
and techniques that could come in handy.
Read about them on cplusplus.com or
cppreference.com or somewhere else. Just
google it!
List

More Related Content

What's hot

What's hot (20)

STL in C++
STL in C++STL in C++
STL in C++
 
Stl Containers
Stl ContainersStl Containers
Stl Containers
 
Sets
SetsSets
Sets
 
Standard Template Library
Standard Template LibraryStandard Template Library
Standard Template Library
 
How to choose best containers in STL (C++)
How to choose best containers in STL (C++)How to choose best containers in STL (C++)
How to choose best containers in STL (C++)
 
Standard template library
Standard template libraryStandard template library
Standard template library
 
8 python data structure-1
8 python data structure-18 python data structure-1
8 python data structure-1
 
List in java
List in javaList in java
List in java
 
Collections and generics
Collections and genericsCollections and generics
Collections and generics
 
LectureNotes-06-DSA
LectureNotes-06-DSALectureNotes-06-DSA
LectureNotes-06-DSA
 
C++ STL 概觀
C++ STL 概觀C++ STL 概觀
C++ STL 概觀
 
L11 array list
L11 array listL11 array list
L11 array list
 
Data structures in c#
Data structures in c#Data structures in c#
Data structures in c#
 
Stl (standard template library)
Stl (standard template library)Stl (standard template library)
Stl (standard template library)
 
2 introduction to data structure
2  introduction to data structure2  introduction to data structure
2 introduction to data structure
 
Data Structures in Python
Data Structures in PythonData Structures in Python
Data Structures in Python
 
Standard template library
Standard template libraryStandard template library
Standard template library
 
Chapter 10: hashing data structure
Chapter 10:  hashing data structureChapter 10:  hashing data structure
Chapter 10: hashing data structure
 
Data structure lecture 2
Data structure lecture 2Data structure lecture 2
Data structure lecture 2
 
Chapter 17 Tuples
Chapter 17 TuplesChapter 17 Tuples
Chapter 17 Tuples
 

Viewers also liked

State of the Word 2011
State of the Word 2011State of the Word 2011
State of the Word 2011photomatt
 
TEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkTEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkVolker Hirsch
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksSlideShare
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShareSlideShare
 

Viewers also liked (7)

SPOJ Problem: OLOLO
SPOJ Problem: OLOLOSPOJ Problem: OLOLO
SPOJ Problem: OLOLO
 
Maps
MapsMaps
Maps
 
Vector
VectorVector
Vector
 
State of the Word 2011
State of the Word 2011State of the Word 2011
State of the Word 2011
 
TEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of WorkTEDx Manchester: AI & The Future of Work
TEDx Manchester: AI & The Future of Work
 
How to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & TricksHow to Make Awesome SlideShares: Tips & Tricks
How to Make Awesome SlideShares: Tips & Tricks
 
Getting Started With SlideShare
Getting Started With SlideShareGetting Started With SlideShare
Getting Started With SlideShare
 

Similar to List

oop lecture framework,list,maps,collection
oop lecture framework,list,maps,collectionoop lecture framework,list,maps,collection
oop lecture framework,list,maps,collectionssuseredfbe9
 
COLLECTIONS.pptx
COLLECTIONS.pptxCOLLECTIONS.pptx
COLLECTIONS.pptxSruthyPJ
 
16. Arrays Lists Stacks Queues
16. Arrays Lists Stacks Queues16. Arrays Lists Stacks Queues
16. Arrays Lists Stacks QueuesIntro C# Book
 
Data structures & algorithms lecture 3
Data structures & algorithms lecture 3Data structures & algorithms lecture 3
Data structures & algorithms lecture 3Poojith Chowdhary
 
Data Structure
Data Structure Data Structure
Data Structure Ibrahim MH
 
Built-in Data Structures in python 3.pdf
Built-in Data Structures in python 3.pdfBuilt-in Data Structures in python 3.pdf
Built-in Data Structures in python 3.pdfalivaisi1
 
Linked List Objective The purpose of this exercise is to cr.pdf
Linked List Objective The purpose of this exercise is to cr.pdfLinked List Objective The purpose of this exercise is to cr.pdf
Linked List Objective The purpose of this exercise is to cr.pdfadityacomputers001
 
Please and Thank youObjective The purpose of this exercise is to .pdf
Please and Thank youObjective The purpose of this exercise is to .pdfPlease and Thank youObjective The purpose of this exercise is to .pdf
Please and Thank youObjective The purpose of this exercise is to .pdfalicesilverblr
 
standard template library(STL) in C++
standard template library(STL) in C++standard template library(STL) in C++
standard template library(STL) in C++•sreejith •sree
 
Prompt Your task is to create a connected list implementation and .pdf
Prompt Your task is to create a connected list implementation and .pdfPrompt Your task is to create a connected list implementation and .pdf
Prompt Your task is to create a connected list implementation and .pdfalsofshionchennai
 
Objective The purpose of this exercise is to create a Linked List d.pdf
Objective The purpose of this exercise is to create a Linked List d.pdfObjective The purpose of this exercise is to create a Linked List d.pdf
Objective The purpose of this exercise is to create a Linked List d.pdfaliracreations
 
Objective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdfObjective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdfadvancethchnologies
 
Objective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdfObjective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdfgiriraj65
 

Similar to List (20)

javacollections.pdf
javacollections.pdfjavacollections.pdf
javacollections.pdf
 
Python list
Python listPython list
Python list
 
List in Python
List in PythonList in Python
List in Python
 
oop lecture framework,list,maps,collection
oop lecture framework,list,maps,collectionoop lecture framework,list,maps,collection
oop lecture framework,list,maps,collection
 
Chapter 15 Lists
Chapter 15 ListsChapter 15 Lists
Chapter 15 Lists
 
COLLECTIONS.pptx
COLLECTIONS.pptxCOLLECTIONS.pptx
COLLECTIONS.pptx
 
16. Arrays Lists Stacks Queues
16. Arrays Lists Stacks Queues16. Arrays Lists Stacks Queues
16. Arrays Lists Stacks Queues
 
Data structures & algorithms lecture 3
Data structures & algorithms lecture 3Data structures & algorithms lecture 3
Data structures & algorithms lecture 3
 
Data Structure
Data Structure Data Structure
Data Structure
 
Built-in Data Structures in python 3.pdf
Built-in Data Structures in python 3.pdfBuilt-in Data Structures in python 3.pdf
Built-in Data Structures in python 3.pdf
 
강의자료6
강의자료6강의자료6
강의자료6
 
Linked List Objective The purpose of this exercise is to cr.pdf
Linked List Objective The purpose of this exercise is to cr.pdfLinked List Objective The purpose of this exercise is to cr.pdf
Linked List Objective The purpose of this exercise is to cr.pdf
 
Please and Thank youObjective The purpose of this exercise is to .pdf
Please and Thank youObjective The purpose of this exercise is to .pdfPlease and Thank youObjective The purpose of this exercise is to .pdf
Please and Thank youObjective The purpose of this exercise is to .pdf
 
standard template library(STL) in C++
standard template library(STL) in C++standard template library(STL) in C++
standard template library(STL) in C++
 
Java collections
Java collectionsJava collections
Java collections
 
Prompt Your task is to create a connected list implementation and .pdf
Prompt Your task is to create a connected list implementation and .pdfPrompt Your task is to create a connected list implementation and .pdf
Prompt Your task is to create a connected list implementation and .pdf
 
Objective The purpose of this exercise is to create a Linked List d.pdf
Objective The purpose of this exercise is to create a Linked List d.pdfObjective The purpose of this exercise is to create a Linked List d.pdf
Objective The purpose of this exercise is to create a Linked List d.pdf
 
List interface
List interfaceList interface
List interface
 
Objective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdfObjective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdf
 
Objective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdfObjective The purpose of this exercise is to create a Linke.pdf
Objective The purpose of this exercise is to create a Linke.pdf
 

Recently uploaded

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfproinshot.com
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Exploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdfExploring the Best Video Editing App.pdf
Exploring the Best Video Editing App.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 

List

  • 1. Level up your coding skills with the C++ Standard Template Library (STL): List BY JOYJIT CHOUDHURY
  • 2. List  List is a sequence container that allows constant time insertion and deletions anywhere in the container  It allows iterations in both directions  Fast random access is not supported  List containers are implemented as Doubly Linked List  Defined in the header <list>  Belongs to the namespace std
  • 4. Accessing the elements  Member functions front() and back(), returns a reference to the first and last element of the list, respectively front() back()
  • 5. Accessing the elements  front() and back() return a reference, so not only can you view the first and last element, you can also modify them list<int> mylist
  • 6. Insert elements  Member functions push_front() and push_back(), inserts an element to the beginning and the end of the list, respectively
  • 7. Delete elements  Member functions pop_front() and pop_back(), removes the first and the last element of the list, respectively
  • 8. Size of the list  Member function size() returns the number of elements in the list  Time Complexity : O(n)
  • 9. Is the list empty?  Member function empty() returns true if the list is empty (i.e. list size is 0), else returns false  Time Complexity : O(1)  It’s a preferred way to check whether a list is empty, instead of checking whether the size of the list is 0, since this takes constant time
  • 10. So, how do you Traverse a list?  The thing about containers is, you hardly know anything about it’s internal mechanisms  All the internal details regarding :  How the memory is allocated  Where and how the data elements are stored  How the insertion, access and removal of individual elements take place It’s all kept hidden from the user.  So, what if you had to access the individual elements, maybe even modify them?  For that purpose, containers have what is known as Iterators
  • 11. What are Iterators?  An iterator is an object, pointing to some element in a range of elements (usually, a container), which has the ability to iterate through the elements in that range through a set of operators (increment (++) operator, dereference (*) operator, etc)  You can think of them as an abstraction of pointers  What that means is, they are like pointers in certain ways, but not exactly
  • 12. Iterators  The best way to understand iterators, would be through an example list<int> myList myList.begin()
  • 14. Insert elements anywhere in the list  Member function insert(), inserts new elements before the element at the specified position. The position is specified by passing an iterator as a parameter.
  • 15. Delete elements from anywhere  Member function erase(), removes from the list, either a single element from the specified position, or all the elements in the specified range [first, last).
  • 16.  That’s not all. There are many other functions and techniques that could come in handy. Read about them on cplusplus.com or cppreference.com or somewhere else. Just google it!