CS 1337 Lecture Notes - Lecture 18: Temporary Variable, Default Constructor, Include Directive

21 views3 pages

Document Summary

// description : hello world in c++, ansi-style. * a vector is a sequence container that works like an array but is dynamic in size. * overload the [ ] to provide access to existing elements. * #include header file to use vectors. * insert in memory and memory objects to a container. Vectors have a lot of different types of iterators. C++ 11 new member functions for stl containers. Function uses a technique called emplacement emplacement avoids creation of temporary objects in memory when adding new. Creates of specific size and defaults the values. Can be used to insert items into a vector. Members such as insert and push_back can cause temporary objects to be created. But if we"re performing large numbers of inesrts, that"s a lot of wasted time. These functions are more efficient than insert and push_back.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents