SlideShare a Scribd company logo
1 of 12
Download to read offline
The C++ Standard
arrangement Libraries
 STL had three basic components
- Package
Generic class arrangement for storing collection of data.
 Method
Generic function arrangement for operating on containers.
 Emphasize
Generalized ‘smart’ pointers that facilitate use of package
They provide an interface that is needed for method to operate
on packages
 String abstraction was added during
standardization.
In 1990, Alex of Hewlett Packard
Laboratories extended C++ with a library
of fine and operations arrangement
which has come to be known as the
Standard .
In 1994, was adopted as part of
ANSI/ISO Standard C++.
Use of STL
 STL offers an assortment of Packages
 STL publicizes the time and storage complexity of its
packages
 STL packages grow and shrink in size automatically
 STL provides built-in algorithms for processing
packages
 STL provides emphasize that make the packages and
methods flexible and efficient.
 STL is extensible which means that users can add new
packages and new methods such that:
 STL methods can process STL packages as well as user
defined packages
 User defined method can process STL packages as well user
defined packages
Strings
 In C we used char * to represent a string.
 The C++ standard library provides a common
implementation of a string fine entrancement
named string.
#include <iostream>
#include <string>
using namespace std;
int main()
{
// create string „str‟ =
“Hello world!”
string str = “Hello
World!”;
cout << str << endl;
return 0;
}
Creating strings
string str = “some text”;
or
string str(“some text”);
other ways:
string s1(7,„a‟);
string s2 = s1;
The size method
str.size() ???
In C we had structs containing only data,
In C++, we have :
class string
{
…
public:
…
unsigned int size();
…
};
String assignment
To assign one string to another
use the “=“ operator.
string str1 = “Sgt. Pappers”;
string str2 = “lonely hearts club bend”;
str2 = str1;
Now : str2 equals “Sgt. Pappers”
Containers
Data structures that hold anything (other
objects).
list: doubly linked list.
vector: similar to a C array, but
dynamic.
map: set of ordered key/value
pairs.
Set: set of ordered keys.
Vector
 Provides an alternative to the built in array.
 A vector is self grown.
 Use It instead of the built in array!

More Related Content

What's hot (11)

Lec3
Lec3Lec3
Lec3
 
Array in c
Array in cArray in c
Array in c
 
Stack Data structure
Stack Data structureStack Data structure
Stack Data structure
 
Themes short introduction :)
Themes short introduction :)Themes short introduction :)
Themes short introduction :)
 
W3C HTML5 KIG-Typed Arrays
W3C HTML5 KIG-Typed ArraysW3C HTML5 KIG-Typed Arrays
W3C HTML5 KIG-Typed Arrays
 
Kaggle tokyo 2018
Kaggle tokyo 2018Kaggle tokyo 2018
Kaggle tokyo 2018
 
Arrays Java
Arrays JavaArrays Java
Arrays Java
 
Arrays in C++
Arrays in C++Arrays in C++
Arrays in C++
 
Core & advanced java classes in mumbai
Core & advanced java classes in mumbaiCore & advanced java classes in mumbai
Core & advanced java classes in mumbai
 
Week 4 dq 4
Week 4 dq 4Week 4 dq 4
Week 4 dq 4
 
concept of data structure
concept of data structureconcept of data structure
concept of data structure
 

Similar to Standard libraries

Stl (standard template library)
Stl (standard template library)Stl (standard template library)
Stl (standard template library)
Hemant Jain
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
TAlha MAlik
 

Similar to Standard libraries (20)

Standard Template Library!
Standard Template Library!Standard Template Library!
Standard Template Library!
 
STL in C++
STL in C++STL in C++
STL in C++
 
Topic12ADTS_GenericDataStructures.ppt
Topic12ADTS_GenericDataStructures.pptTopic12ADTS_GenericDataStructures.ppt
Topic12ADTS_GenericDataStructures.ppt
 
Topic12ADTS_GenericDataStructures.ppt
Topic12ADTS_GenericDataStructures.pptTopic12ADTS_GenericDataStructures.ppt
Topic12ADTS_GenericDataStructures.ppt
 
An Introduction to the C++ Standard Library
An Introduction to the C++ Standard LibraryAn Introduction to the C++ Standard Library
An Introduction to the C++ Standard Library
 
Introduction to C++, Standard Library, Class Template vector.pptx
Introduction to C++, Standard  Library, Class Template  vector.pptxIntroduction to C++, Standard  Library, Class Template  vector.pptx
Introduction to C++, Standard Library, Class Template vector.pptx
 
Stl (standard template library)
Stl (standard template library)Stl (standard template library)
Stl (standard template library)
 
Collection
CollectionCollection
Collection
 
lecture-5 string.pptx
lecture-5 string.pptxlecture-5 string.pptx
lecture-5 string.pptx
 
Introduction to r studio on aws 2020 05_06
Introduction to r studio on aws 2020 05_06Introduction to r studio on aws 2020 05_06
Introduction to r studio on aws 2020 05_06
 
2CPP16 - STL
2CPP16 - STL2CPP16 - STL
2CPP16 - STL
 
Cpp-c++.pptx
Cpp-c++.pptxCpp-c++.pptx
Cpp-c++.pptx
 
Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
 
Data Strucure with STL
Data Strucure with STL Data Strucure with STL
Data Strucure with STL
 
CSharp for Unity - Day 1
CSharp for Unity - Day 1CSharp for Unity - Day 1
CSharp for Unity - Day 1
 
Stl
StlStl
Stl
 
The use of the code analysis library OpenC++: modifications, improvements, er...
The use of the code analysis library OpenC++: modifications, improvements, er...The use of the code analysis library OpenC++: modifications, improvements, er...
The use of the code analysis library OpenC++: modifications, improvements, er...
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 
lecture02-cpp.ppt
lecture02-cpp.pptlecture02-cpp.ppt
lecture02-cpp.ppt
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 

Recently uploaded (20)

male presentation...pdf.................
male presentation...pdf.................male presentation...pdf.................
male presentation...pdf.................
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjjStl Algorithms in C++ jjjjjjjjjjjjjjjjjj
Stl Algorithms in C++ jjjjjjjjjjjjjjjjjj
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH FORM 50 CÂU TRẮC NGHI...
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Major project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategiesMajor project report on Tata Motors and its marketing strategies
Major project report on Tata Motors and its marketing strategies
 
MOOD STABLIZERS DRUGS.pptx
MOOD     STABLIZERS           DRUGS.pptxMOOD     STABLIZERS           DRUGS.pptx
MOOD STABLIZERS DRUGS.pptx
 
An overview of the various scriptures in Hinduism
An overview of the various scriptures in HinduismAn overview of the various scriptures in Hinduism
An overview of the various scriptures in Hinduism
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 

Standard libraries

  • 1.
  • 2.
  • 3. The C++ Standard arrangement Libraries  STL had three basic components - Package Generic class arrangement for storing collection of data.  Method Generic function arrangement for operating on containers.  Emphasize Generalized ‘smart’ pointers that facilitate use of package They provide an interface that is needed for method to operate on packages  String abstraction was added during standardization.
  • 4. In 1990, Alex of Hewlett Packard Laboratories extended C++ with a library of fine and operations arrangement which has come to be known as the Standard . In 1994, was adopted as part of ANSI/ISO Standard C++.
  • 5. Use of STL  STL offers an assortment of Packages  STL publicizes the time and storage complexity of its packages  STL packages grow and shrink in size automatically  STL provides built-in algorithms for processing packages  STL provides emphasize that make the packages and methods flexible and efficient.  STL is extensible which means that users can add new packages and new methods such that:  STL methods can process STL packages as well as user defined packages  User defined method can process STL packages as well user defined packages
  • 6. Strings  In C we used char * to represent a string.  The C++ standard library provides a common implementation of a string fine entrancement named string.
  • 7. #include <iostream> #include <string> using namespace std; int main() { // create string „str‟ = “Hello world!” string str = “Hello World!”; cout << str << endl; return 0; }
  • 8. Creating strings string str = “some text”; or string str(“some text”); other ways: string s1(7,„a‟); string s2 = s1;
  • 9. The size method str.size() ??? In C we had structs containing only data, In C++, we have : class string { … public: … unsigned int size(); … };
  • 10. String assignment To assign one string to another use the “=“ operator. string str1 = “Sgt. Pappers”; string str2 = “lonely hearts club bend”; str2 = str1; Now : str2 equals “Sgt. Pappers”
  • 11. Containers Data structures that hold anything (other objects). list: doubly linked list. vector: similar to a C array, but dynamic. map: set of ordered key/value pairs. Set: set of ordered keys.
  • 12. Vector  Provides an alternative to the built in array.  A vector is self grown.  Use It instead of the built in array!