SlideShare a Scribd company logo
Standard libraries
Standard libraries
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

DOCX
Programming in c plus plus4
PPTX
PPT
Lec3
PPT
Visula C# Programming Lecture 5
PDF
Introduction to Hadoop : A bird eye's view | Abhishek Mukherjee
PDF
Algorithm and Data Structure - Array and Struct
PPTX
Data Applied: Clustering
PDF
Memory layout in C++ vis a-vis polymorphism and padding bits
Programming in c plus plus4
Lec3
Visula C# Programming Lecture 5
Introduction to Hadoop : A bird eye's view | Abhishek Mukherjee
Algorithm and Data Structure - Array and Struct
Data Applied: Clustering
Memory layout in C++ vis a-vis polymorphism and padding bits

What's hot (11)

PPTX
Array in c
PPTX
Stack Data structure
PDF
Themes short introduction :)
PDF
W3C HTML5 KIG-Typed Arrays
PDF
Kaggle tokyo 2018
PDF
Arrays Java
PDF
Arrays in C++
PPT
Core & advanced java classes in mumbai
DOC
Week 4 dq 4
PPTX
concept of data structure
Array in c
Stack Data structure
Themes short introduction :)
W3C HTML5 KIG-Typed Arrays
Kaggle tokyo 2018
Arrays Java
Arrays in C++
Core & advanced java classes in mumbai
Week 4 dq 4
concept of data structure
Ad

Similar to Standard libraries (20)

PPTX
CMSC 202 - Lec20 - Containers and Iterators(2).pptx
PPT
2CPP16 - STL
PDF
An Introduction to the C++ Standard Library
PDF
STL in C++
PPTX
Data Strucure with STL
PPTX
Introduction to C++, Standard Library, Class Template vector.pptx
PPTX
C++ language
PPTX
Opject Oriented Brogramming - WHat is that?
PDF
C++ Standard Template Library
DOCX
PDF
C++primer
PPTX
Cs1123 3 c++ overview
PPTX
C++ process new
PPTX
Standard template library
PDF
C++14 - Modern Programming for Demanding Times
PDF
C++ Advanced Features
PDF
C++ Advanced Features
PPTX
Learn c++ Programming Language
PPTX
Standard template library
PPT
Stl (standard template library)
CMSC 202 - Lec20 - Containers and Iterators(2).pptx
2CPP16 - STL
An Introduction to the C++ Standard Library
STL in C++
Data Strucure with STL
Introduction to C++, Standard Library, Class Template vector.pptx
C++ language
Opject Oriented Brogramming - WHat is that?
C++ Standard Template Library
C++primer
Cs1123 3 c++ overview
C++ process new
Standard template library
C++14 - Modern Programming for Demanding Times
C++ Advanced Features
C++ Advanced Features
Learn c++ Programming Language
Standard template library
Stl (standard template library)
Ad

Recently uploaded (20)

PPTX
Cell Types and Its function , kingdom of life
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
master seminar digital applications in india
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PDF
Business Ethics Teaching Materials for college
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Pre independence Education in Inndia.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Classroom Observation Tools for Teachers
PDF
Complications of Minimal Access Surgery at WLH
Cell Types and Its function , kingdom of life
Microbial diseases, their pathogenesis and prophylaxis
Week 4 Term 3 Study Techniques revisited.pptx
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Renaissance Architecture: A Journey from Faith to Humanism
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
master seminar digital applications in india
Pharmacology of Heart Failure /Pharmacotherapy of CHF
O5-L3 Freight Transport Ops (International) V1.pdf
Supply Chain Operations Speaking Notes -ICLT Program
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
Business Ethics Teaching Materials for college
2.FourierTransform-ShortQuestionswithAnswers.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Pre independence Education in Inndia.pdf
RMMM.pdf make it easy to upload and study
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Classroom Observation Tools for Teachers
Complications of Minimal Access Surgery at WLH

Standard libraries

  • 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!