Standard template library , C/C++ Programming

The STL details are described in many places online (see the CS377 webpage for some links), and there's a very quick introduction in Section A.14. Here are just a few additional notes: Function calls in C++ pass by value, making a copy of the argument. If you need to modify the argument, or if making a copy of a large object would be consume too much time and memory, then passing by reference (a pointer) is often preferable.

Similarly, many of the STL methods (e.g. insert(), etc) are set up to pass potentially large objects by value, rather than by reference. For this reason, one might want to create objects composed of pointers, rather than objects. For example, if you wanted a queue-of-queues, with larger datasets, you'd probably want to use a queue-of-pointers-to-queues instead, such as

queue*> my_queue;

rather than

queue > my_queue;

Posted Date: 3/12/2013 4:01:39 AM | Location : United States

Related Discussions:- Standard template library , Assignment Help, Ask Question on Standard template library , Get Answer, Expert's Help, Standard template library Discussions

Write discussion on Standard template library
Your posts are moderated
Related Questions
Your program will read two kinds of data from two files: names and predicates. It will read a formal expression from standard input and check whether that expression is syntactical

P o i n t e r d e c l a r a t i o n f o r d a t a m e m b e r : M e t h o d 1 : i n t M : : * p x ; / / T h i s

C Program for REVERSE THE STRING #include stdio.h> #include conio.h> #include string.h> void main() {           char name[30];           char *s;

Literals (Constants) Constants are data storage locations whose address is not accessible for the user. Their value is not altered during the course of the program. Literal

Pos Console CPP Unit Testing Project Description: Do the CPPUnit Testing for the project. Have all the functions done. Skills required are Android, C Programming, C++ Prog

There are ''n'' ants on a ''n+1'' length rod. The ants are numbered from 1 to n and are initially placed at positions starting from position 1 till position n. They are moving eith

What data structure would you mostly likely see in a nonrecursive implementation of a recursive algorithm?Minimum 100 words accepted#

drawbacks in assignments in engeenirng

Project Description: I am seeking someone who can make this modem work with Linux Caller ID on Ubuntu present stable version. Skills required are C Programming, Python

The new and delete operators The C language has explained library functions- malloc() and free() for dynamic allocation and de-allocation of memory. C++ gives yet another appro