SlideShare a Scribd company logo
1 of 8
‫استاندارد‬ ‫کتابخانه‬ ‫معرفی‬
‫استاندارد‬ ‫کتابخانه‬ ‫سرآیندهای‬
 String
 Stream I/O
 Input , output, user-defined types
 Containers
 Vector, list, map, unordered_map, …
 Algorithm
 Use of iterators, iterator types, stream iterator, …
 Run-time language support
 C standard library
 String and I/O streams
 Framework of containers and algorithms
 Support for numerical computations
 Support for concurrent programming
 Utilities to support meta programming
 Smart pointers for resource management
 Special-purpose containers
‫زبان‬ ‫در‬ ‫نویسی‬ ‫برنامه‬ ‫به‬ ‫کمک‬C++
‫کلی‬ ‫فرم‬ ‫یک‬ ‫کردن‬ ‫فراهم‬
‫آسان‬ ‫استفاده‬ ‫و‬ ‫گیری‬ ‫یاد‬
01. #include <string>
02. #include <list>
03.
04. std::string s {"Four legs Good; two legs Baaad!"};
05. std::list<std::string> slogans {"War is peace",
06. "Freedom is Slavery", "Ignorance isStrength"};
01. // make the standard string facilities accessible
02. #include <string>
03.
04. // make std names available without std:: prefix
05. using namespace std;
06.
07. // OK: string is std::string
08. string s {"C++ is a general–purpose programming language"};
<algorithm> copy(), find(), sort()
<array> array
<chrono> duration, time_point
<cmath> sqrt(), pow()
<complex> complex, sqrt(), pow()
<fstream> fstream, ifstream, ofstream
<future> future, promise
<iostream> istream, ostream, cin, cout
<map> map, multimap
<memory> unique_ptr, shared_ptr, allocator
<random> default_random_engine, normal_distribution
<regex> regex, smatch
<string> string, basic_string
<sstream> istrstream, ostrstream
<thread> thread
<unordered_map> unordered_map, unordered_multimap
<utility> move(), swap(), pair
<vector> vector
12. standard library introduction

More Related Content

What's hot

What's hot (14)

Avro2 tf: a data processing engine for tensorflow
Avro2 tf: a data processing engine for tensorflowAvro2 tf: a data processing engine for tensorflow
Avro2 tf: a data processing engine for tensorflow
 
Standard Library Functions
Standard Library FunctionsStandard Library Functions
Standard Library Functions
 
Data types
Data typesData types
Data types
 
Java Datatypes
Java DatatypesJava Datatypes
Java Datatypes
 
Python l3
Python l3Python l3
Python l3
 
Java basic datatypes
Java basic datatypesJava basic datatypes
Java basic datatypes
 
Introduction to dot net framework
Introduction to dot net frameworkIntroduction to dot net framework
Introduction to dot net framework
 
Java basic data types
Java basic data typesJava basic data types
Java basic data types
 
Data type
Data typeData type
Data type
 
Cpu.ppt INTRODUCTION TO “C”
Cpu.ppt INTRODUCTION TO “C” Cpu.ppt INTRODUCTION TO “C”
Cpu.ppt INTRODUCTION TO “C”
 
Lect9
Lect9Lect9
Lect9
 
3rd june
3rd june3rd june
3rd june
 
Net framework
Net frameworkNet framework
Net framework
 
Datatypes in c
Datatypes in cDatatypes in c
Datatypes in c
 

Similar to 12. standard library introduction

Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
TAlha MAlik
 
Cs1123 11 pointers
Cs1123 11 pointersCs1123 11 pointers
Cs1123 11 pointers
TAlha MAlik
 
Runtime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya RathoreRuntime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya Rathore
Esha Yadav
 
NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandra
rantav
 

Similar to 12. standard library introduction (20)

Cs1123 3 c++ overview
Cs1123 3 c++ overviewCs1123 3 c++ overview
Cs1123 3 c++ overview
 
C tutorial
C tutorialC tutorial
C tutorial
 
U-SQL Reading & Writing Files (SQLBits 2016)
U-SQL Reading & Writing Files (SQLBits 2016)U-SQL Reading & Writing Files (SQLBits 2016)
U-SQL Reading & Writing Files (SQLBits 2016)
 
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
 
Console I/o & basics of array and strings.pptx
Console I/o & basics of array and strings.pptxConsole I/o & basics of array and strings.pptx
Console I/o & basics of array and strings.pptx
 
C++ ppt
C++ pptC++ ppt
C++ ppt
 
C++ ppt.pptx
C++ ppt.pptxC++ ppt.pptx
C++ ppt.pptx
 
Cs1123 11 pointers
Cs1123 11 pointersCs1123 11 pointers
Cs1123 11 pointers
 
Runtime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya RathoreRuntime Environment Of .Net Divya Rathore
Runtime Environment Of .Net Divya Rathore
 
Theory1&amp;2
Theory1&amp;2Theory1&amp;2
Theory1&amp;2
 
Datatype
DatatypeDatatype
Datatype
 
NOSQL and Cassandra
NOSQL and CassandraNOSQL and Cassandra
NOSQL and Cassandra
 
Apache Arrow Workshop at VLDB 2019 / BOSS Session
Apache Arrow Workshop at VLDB 2019 / BOSS SessionApache Arrow Workshop at VLDB 2019 / BOSS Session
Apache Arrow Workshop at VLDB 2019 / BOSS Session
 
C # (C Sharp).pptx
C # (C Sharp).pptxC # (C Sharp).pptx
C # (C Sharp).pptx
 
C#
C#C#
C#
 
C language
C languageC language
C language
 
C101 – Intro to Programming with C
C101 – Intro to Programming with CC101 – Intro to Programming with C
C101 – Intro to Programming with C
 
Bringing nullability into existing code - dammit is not the answer.pptx
Bringing nullability into existing code - dammit is not the answer.pptxBringing nullability into existing code - dammit is not the answer.pptx
Bringing nullability into existing code - dammit is not the answer.pptx
 
Avro intro
Avro introAvro intro
Avro intro
 
HBase Data Modeling and Access Patterns with Kite SDK
HBase Data Modeling and Access Patterns with Kite SDKHBase Data Modeling and Access Patterns with Kite SDK
HBase Data Modeling and Access Patterns with Kite SDK
 

More from Vahid Heidari

More from Vahid Heidari (17)

18. utilities
18. utilities18. utilities
18. utilities
 
17. thread and deadlock
17. thread and deadlock17. thread and deadlock
17. thread and deadlock
 
16. smart pointers
16. smart pointers16. smart pointers
16. smart pointers
 
15. map, unordered map, algorithms
15. map, unordered map, algorithms15. map, unordered map, algorithms
15. map, unordered map, algorithms
 
14. containers, vector, list
14. containers, vector, list14. containers, vector, list
14. containers, vector, list
 
13. string, io streams
13. string, io streams13. string, io streams
13. string, io streams
 
11. template
11. template11. template
11. template
 
10. copy and move
10. copy and move10. copy and move
10. copy and move
 
9. class hierarchies
9. class hierarchies9. class hierarchies
9. class hierarchies
 
8. abstract types
8. abstract types8. abstract types
8. abstract types
 
7. abstraction mechanisms, containers
7. abstraction mechanisms, containers7. abstraction mechanisms, containers
7. abstraction mechanisms, containers
 
6. separation, namespace, error
6. separation, namespace, error6. separation, namespace, error
6. separation, namespace, error
 
5. struct, class, enum
5. struct, class, enum5. struct, class, enum
5. struct, class, enum
 
4. pointers, arrays
4. pointers, arrays4. pointers, arrays
4. pointers, arrays
 
3. tests, loops
3. tests, loops3. tests, loops
3. tests, loops
 
2. types, vars, arith, consts
2. types, vars, arith, consts2. types, vars, arith, consts
2. types, vars, arith, consts
 
1. preface, hello world
1. preface, hello world1. preface, hello world
1. preface, hello world
 

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
+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
 

Recently uploaded (20)

The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
The Guide to Integrating Generative AI into Unified Continuous Testing Platfo...
 
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-...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
+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...
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
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
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
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
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
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
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
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 ...
 
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
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
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
 
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
 

12. standard library introduction

  • 1.
  • 3.  String  Stream I/O  Input , output, user-defined types  Containers  Vector, list, map, unordered_map, …  Algorithm  Use of iterators, iterator types, stream iterator, …
  • 4.  Run-time language support  C standard library  String and I/O streams  Framework of containers and algorithms  Support for numerical computations  Support for concurrent programming  Utilities to support meta programming  Smart pointers for resource management  Special-purpose containers
  • 5. ‫زبان‬ ‫در‬ ‫نویسی‬ ‫برنامه‬ ‫به‬ ‫کمک‬C++ ‫کلی‬ ‫فرم‬ ‫یک‬ ‫کردن‬ ‫فراهم‬ ‫آسان‬ ‫استفاده‬ ‫و‬ ‫گیری‬ ‫یاد‬
  • 6. 01. #include <string> 02. #include <list> 03. 04. std::string s {"Four legs Good; two legs Baaad!"}; 05. std::list<std::string> slogans {"War is peace", 06. "Freedom is Slavery", "Ignorance isStrength"}; 01. // make the standard string facilities accessible 02. #include <string> 03. 04. // make std names available without std:: prefix 05. using namespace std; 06. 07. // OK: string is std::string 08. string s {"C++ is a general–purpose programming language"};
  • 7. <algorithm> copy(), find(), sort() <array> array <chrono> duration, time_point <cmath> sqrt(), pow() <complex> complex, sqrt(), pow() <fstream> fstream, ifstream, ofstream <future> future, promise <iostream> istream, ostream, cin, cout <map> map, multimap <memory> unique_ptr, shared_ptr, allocator <random> default_random_engine, normal_distribution <regex> regex, smatch <string> string, basic_string <sstream> istrstream, ostrstream <thread> thread <unordered_map> unordered_map, unordered_multimap <utility> move(), swap(), pair <vector> vector

Editor's Notes

  1. ما از این ویدیو وارد فصل چهارم کتاب the c++ programming language شدیم. تو فصل چهارم کتابخونه ی استاندارد شامل Containerها و الگوریتم ها رو بررسی خواهیم کرد. در این ویدیو یه معرفی کلی در مورد standard library یا کتابخونه استاندارد خواهم کرد و در آخر هدر فایل های پر کاربرد در کتابخونه استاندارد رو معرفی می کنم.
  2. در تمام زبانهای برنامه نویسی کتابخونه هایی وجود دارند که برنامه نویس با استفاده از اونا کار توسعه ی برنامه های خودش رو انجام میده. این کتابخونه ها کمک می کنن که برنامه نویس از اول مجبور نشه همه چیز رو بنویسه. زمانی که شما یه کامپایلر یا IDEی C++ رو نصب می کنید به همراهش کتابخونه استاندارد هم نصب میشه. هر پیاده سازی کامل از ISO C++ باید این کتابخونه ها رو داشته باشه String برای کار بار رشته ها. IO stream برای کار با ورودی و خروجی های استاندارد. Containerهای پر کاربرد و الگوریتم های پر کاربرد و عمومی. در ویدیو های آینده هر کدون از این قسمت ها توضیح داده خواهند شد.
  3. اما کتابخونه استاندارد خودش به چند قسمت تقسیم میشه: Run-time language support مثل Allocation و type informationهای مورد نیاز زمان اجرا. کتابخونه استاندارد C البته با کمی تغیرات که باعث بهبودش میشه و violationها رو کمتر می کنه. String و I/O stream ها بطوری که کاراکتر ست های سیستم های مختلف رو support کنه. Containerهای پر استفاده مثل Vector و map و همینطور الگوریتم های پر کاربرد که باید با ساختمان داده های ارائه شده برای Containerها سازگار باشه. توابع و ساختمان داده های مورد استفاده برای محاسبات عددی و ریاضی پشتیبانی از برنامه نویسی همروند مثل threadها و lookها امکانات مورد نیاز برای template meta programming Smart pointerها مثل unique_ptr و shared_ptr برای مدیریت منابع و در نهایت یه سری containerهای خاص منظوره مثل arrayو bitsetو tuple و غیره
  4. قواعد و استانداردی که کتابخونه استاندارد باید رعایت کنه و کلاسها و امکانات اون ملزم به رعایت اونا هستند به این شرح هستند. باید به صورتی باشه که به برنامه نویسی به زبان C++ کمک کنه و امکاناتی که در تمامی برنامه هایی که قراره با C++ نوشته بشه استفاده می شن و کاربرد دارن رو فراهم کنه. باید یه general form ارائه بده به صورتی که overhead یا سربار اون نسبت به نسخه های ساده تر همون کتابخونه که افراد دیگه ای نوشتن هم خیلی کم باشه و در آخر باید یادگیری کتابخونه استاندارد تا حد امکان راحت باشه و استفاده کردن از امکاناتش هم باید آسون باشه، به نحوی که پیچیدگیهای درونی اون از دید کاربر مخفی بمونه کتابخونه استاندارد تمامی ساختمان داده های پایه ای و اساسی رو به همراه الگوریتم هایی که روی اونا استفاده می شه رو فراهم کرده.
  5. تمامی امکانات کتابخونه استاندارد در header فایل های استانداردی هم قرار دارند. توی این مثال با include کردن string و list در خطوط اول و دوم امکانات این کتابخونه ها در دسترس ما قرار میگیره. کتابخونه استاندارد در یک namespace به نام std قرار داره. در نتیجه برای استفاده کردن از امکانات اون باید از پیشوند std:: استفاده کرد. برای مخفف نویسی میشه بعد از include کردن کتابخونه با استفاده از using به کامپایلر بگیم که می خوایم از امکاناتی که داخل فضای نام std هست استفاده کنیم و از اون به بعد دیگه std:: رو ننویسیم و کارمون راحت تر میشه. برای استفاده کردن و کامپایل شدن برنامه ها حتما باید کتابخونه ی مناسب رو include کرد.
  6. توی این اسلاید پر کاربرد ترین هدر فایل های مورد استفاده در C++ رو میبینید. مثلا الگوریتم دارای الگوریتم های پر کاربرد و عمومی برای کار با بقیه قسمتهای کتابخونست ویا وکتور و map و لیست و string شامل data structure هاییه که تقریبا توی تمام برنامه های سی پلاس پلاس استفاده میشن و غیره. کتابخونه های زبان c با پیشوند c شروع می شن مثل cmath یا cstring و غیره. لیست کامل رو می تونید توی اینترنت سرچ کنید یا اینکه کتابهایی که در مورد کتابخونه استاندارد هستند رو مطالعه کنید.
  7. در این ویدیو وارد فصل چهارم کتاب شدیم که کتابخونه استاندارد رو معرفی می کنه. قواعد و استاندارد هایی که ISO برای اضافه کردن امکانات جدید گذاشته رو هم اشاره کردیم و سرآیند های مهم رو معرفی کردیم.