Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > c++ stl

Reply
Thread Tools

c++ stl

 
 
ramtin
Guest
Posts: n/a
 
      02-18-2011
hi all ,
i want to learn stl c++ programing .
but i actully dont know what stl really is (?)
if any one know a good text book for it plz send it links for me .
and i want to code one of it function in c programing which one do you
think is good for me (to code it) as i am new at this . . .
thanks of all
 
Reply With Quote
 
 
 
 
MiB
Guest
Posts: n/a
 
      02-18-2011
On Feb 18, 8:22*am, ramtin <tom.t.2...@gmail.com> wrote:
> i want to learn stl c++ programing .
> but i actully dont know what stl really is (?)


The STL or "Standard Template Library" is a collection of template
classes and functions. For me, it helps most to shift my focus in
application programmers from dealing with low-level implementation
details to addressing the actual problem I need to solve. The STL
covers containers (vectors, lists, sets, associative maps, ...),
character strings, algorithms (sorting, searching, aggregation, ...),
and more. It is part of the C++ standard, so anything you code using
the defined interface of the STL works with any standard complying C++
compiler.

> if any one know a good text book for it plz send it links for me .


I would like to recommend you the excellent introduction to the STL by
Stephan T. Lavavej, available as a ten-part video lecture here:
http://channel9.msdn.com/Shows/Going...phan-T-Lavavej
Aside from being a real expert on the STL, Mr. Lavavej is a hard to
find talent at teaching. I personally enjoy watching his lectures a
lot. It is a wonderful contrast to these horrible "dialog-style" shows
(Tom: "We have this really cool thing here, that will make everybody's
life just perfect, what do you think, Bob?" --- Bob: "Yeah, Tom, this
is so great...", over and over, with no actual information conveyed.)

Since he is an Microsoft employee, and Microsoft is sponsoring the
lectures, the presentation is somewhat centered around Visual C++
2010. However, any examples and code shown do not depend on the
Windows operating system or Microsoft IDEs, and should work on Linux /
g++ or other standard compliant compilers without, or minimal change.
Plus, watching the show is free, so I won't complain on some product
placement commercial.

> and i want to code one of it function in c programing which one do you
> think is good for me (to code it) as i am new at this . . .


I'd recommend to start a project around a problem from *your* personal
life; something where you feel expert at, or have a hobby interest
anyway. Do you collect bottle caps? Go on, create a program that keeps
track of your 10,000+ exhibits and growing collection. Do you do some
team sports? How about a match making or tournament administration
software? Do you work at a pizza restaurant? Make a pizza order by
internet software. You have an old pocket calculator you used at
school? Create a simulation of it. There is plenty of ideas from your
environment, so you don't need to look out for projects thousands of
programmers solved already ad nauseam. I'd find it very hard to come
up with a practical problem where the STL would not be of use.

just my $.02,

MiB.
 
Reply With Quote
 
 
 
 
K4 Monk
Guest
Posts: n/a
 
      02-18-2011
On Feb 18, 12:22*pm, ramtin <tom.t.2...@gmail.com> wrote:
> hi all ,
> i want to learn stl c++ programing .
> but i actully dont know what stl really is (?)
> if any one know a good text book for it plz send it links for me .
> and i want to code one of it function in c programing which one do you
> think is good for me (to code it) as i am new at this . . .
> thanks of all


I am a C++ newbie and my understanding is this:

STL = Standard Template Library....the keyword here is "Template".

Basically there are many operations and data structures which are very
common in the programming world and they only way their implementation
differs is through the types of objects they manipulate. So, for
example one implementation could manipulate a queue of "Battleships"
and another implementation could have "Teacups", but at their core,
they are both "queues".

The STL is a project which has factored out the common theme among
many such data structures, so that with a little tweaking you can
create your own data structures and generic containers without
reinventing the wheel.

So for example, instead of doing the following:

class integerLinkedList { };
integerLinkedList l1;

class charLinkedList { };
charLinkedList l2;

you can do:

list<int> l1;
list<char> l2;

and you can have the same universal operations available for both
objects
 
Reply With Quote
 
Rui Maciel
Guest
Posts: n/a
 
      02-18-2011
Pete Becker wrote:

> MiB is correct, but note that many people use "STL" to refer to the C++
> STandard Library.
>


The C++ standard library encompasses a bit more components than the
STL[1]. If "many people" refer to the C++'s standard library as "STL"
then "many people" are making a mistake.


Rui Maciel

[1] http://en.wikipedia.org/wiki/C%2B%2B_Standard_Library
 
Reply With Quote
 
Rui Maciel
Guest
Posts: n/a
 
      02-18-2011
Leigh Johnston wrote:

> Mistake? not at all; the meaning of words and abbreviations can change
> over time. These days when somebody says "STL" they often are referring
> to the C++ Standard Library rather than the original Standard Template
> Library which includes stuff that is not part of currently standardized
> C++ Standard Library.


The meaning of "STL" can only "change over time" to be understood as the
C++ standard library if the mistake of confusing the Standard Template
Library with the C++ standard library is reiterated and perpetuated over
time.


Rui Maciel
 
Reply With Quote
 
Paul
Guest
Posts: n/a
 
      02-18-2011

"Rui Maciel" <> wrote in message
news:4d5ef3fa$0$24801$...
> Leigh Johnston wrote:
>
>> Mistake? not at all; the meaning of words and abbreviations can change
>> over time. These days when somebody says "STL" they often are referring
>> to the C++ Standard Library rather than the original Standard Template
>> Library which includes stuff that is not part of currently standardized
>> C++ Standard Library.

>
> The meaning of "STL" can only "change over time" to be understood as the
> C++ standard library if the mistake of confusing the Standard Template
> Library with the C++ standard library is reiterated and perpetuated over
> time.
>
>

Quite true.

 
Reply With Quote
 
James Kanze
Guest
Posts: n/a
 
      02-18-2011
On Feb 18, 9:52 pm, Rui Maciel <rui.mac...@gmail.com> wrote:
> Pete Becker wrote:
> > MiB is correct, but note that many people use "STL" to refer
> > to the C++ STandard Library.


> The C++ standard library encompasses a bit more components
> than the STL[1]. If "many people" refer to the C++'s standard
> library as "STL" then "many people" are making a mistake.


The C++ standard library is largely a "template" library. And
if a library is "standard", and it is "template", how can
calling it a "standard template library" be a mistake. (One
could argue that calling Stepanov's library a "standard template
library" is misleading advertising, because it certainly wasn't
"standard". At least in the sense that ISO uses "standard".)

The actual meaning of a word depends on common usage, which
means that in this regard, "most people" can never be wrong, In
practice, the usage that I've seen most frequently (but far from
exclusively) would use STL for the parts of Stepanov's library
that were adopted by ISO (but not the other parts), plus
elements of the C++ standard library, like std::basic_string,
which have been STLized. Although the limits are not precise,
this would exclude things like iostream and operator new, but
include basic_string, and perhaps other elements, that weren't
in Stepanov's library. But as I say, the limits are not
precise, and not a few people would include the entire standard
C++ library. If you need to be precise, I'd avoid the term STL.

--
James Kanze

 
Reply With Quote
 
James Kanze
Guest
Posts: n/a
 
      02-18-2011
On Feb 18, 10:34 pm, Rui Maciel <rui.mac...@gmail.com> wrote:
> Leigh Johnston wrote:
> > Mistake? not at all; the meaning of words and abbreviations can change
> > over time. These days when somebody says "STL" they often are referring
> > to the C++ Standard Library rather than the original Standard Template
> > Library which includes stuff that is not part of currently standardized
> > C++ Standard Library.


> The meaning of "STL" can only "change over time" to be understood as the
> C++ standard library if the mistake of confusing the Standard Template
> Library with the C++ standard library is reiterated and perpetuated over
> time.


Which is, or has been, the case. As Leigh says, language
evolves, and today, the exact meaning of STL depends on who is
talking---in other words, the acronym doesn't have an exact
meaning. In many ways, Humpty Dumpty is right. "When I use a
word, it means just what I choose it to mean." Of course, if I
choose something very different from what other people
understand, communication is rendered significantly more
difficult, but in the end, each speaker chooses his or her
vocabulary according to their personal beliefs. And when the
personal beliefs of a majority of a liguistic group change, the
generally accepted meaning changes.

--
James Kanze
 
Reply With Quote
 
James Kanze
Guest
Posts: n/a
 
      02-18-2011
On Feb 18, 11:02 pm, Leigh Johnston <le...@i42.co.uk> wrote:
> On 18/02/2011 22:34, Rui Maciel wrote:


> > Leigh Johnston wrote:


> >> Mistake? not at all; the meaning of words and abbreviations
> >> can change over time. These days when somebody says "STL"
> >> they often are referring to the C++ Standard Library rather
> >> than the original Standard Template Library which includes
> >> stuff that is not part of currently standardized C++
> >> Standard Library.


> > The meaning of "STL" can only "change over time" to be
> > understood as the C++ standard library if the mistake of
> > confusing the Standard Template Library with the C++
> > standard library is reiterated and perpetuated over time.


> **** happens.




Which is a very succinct summary of what I said in a lot more
words.

--
James Kanze
 
Reply With Quote
 
Jorgen Grahn
Guest
Posts: n/a
 
      02-19-2011
On Fri, 2011-02-18, James Kanze wrote:
> On Feb 18, 9:52 pm, Rui Maciel <rui.mac...@gmail.com> wrote:
>> Pete Becker wrote:
>> > MiB is correct, but note that many people use "STL" to refer
>> > to the C++ STandard Library.

>
>> The C++ standard library encompasses a bit more components
>> than the STL[1]. If "many people" refer to the C++'s standard
>> library as "STL" then "many people" are making a mistake.

>
> The C++ standard library is largely a "template" library.


I think of it as three parts: the C library (which is a quite large
part!), the parts from (or compatible with) the original STL
(containers, iterators and algorithms), and some other stuff
(iostreams, locales, possibly std::string ...).

Personally, when I say STL (which is rarely) I mean the second part.
You'd never hear me claim std:rintf is part of the STL.

/Jorgen

--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Segmentation Fault on stl::resize / stl::clear Steve C++ 2 11-06-2007 06:53 AM
stl questions: how can I compare 2 stl list? silverburgh.meryl@gmail.com C++ 5 04-16-2006 09:57 PM
a stl map which use stl pair as the key Allerdyce.John@gmail.com C++ 2 02-22-2006 07:25 AM
Copy elements from one STL container to another STL container Marko.Cain.23@gmail.com C++ 4 02-16-2006 05:03 PM
To STL or not to STL Allan Bruce C++ 41 10-17-2003 08:21 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57