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
Develop a Student class that has the following header file: #ifndef STUDENT_H #define STUDENT_H #include #include #include using namespace std; class Stu

limitation of linear array

overload assignment opertor to assign the data of one object to anthor

Define a structure to store roll no, name and marks of a student. b) Using the structure of Q2. a), above write a ''C'' program to create a file "student.dat". There must be one r

A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string of t

Stack operations - C++: Write a program to define basic stack operations in c++. int Stack::push(int elem) {    int m = getmax();    if (top    {       put_

Explain  U s e r - D e f i n e d D a t a T y p es? C has Union and Structure as user-defined data types.  C++ has class which looks like structure with a

Program is to check whether the string entered is a palindrome or not: Program is to check whether the string entered is a palindrome or not invoke function from main int p

Create an applet that bounces a blue ball inside an applet using Thread. The ball (diameter is 10) will start at position (0,0). When the ball hits the edge of the applet, the ba

What are the debugging methods you employ while came across a problem? A: Debugging with tools such as: 1.      DBG, GDB ,Forte, Visual Studio. 2.      Using tusc to trace