About STL meaning

xiaoxiao2021-03-30  202

STL encapsulates a bunch of underlying algorithms, but why many learning C is different for STL worship, I want to ask if everyone thinks STL is the biggest meaning?

Is there any library on the database?

C is a great language. The only defect is related to the library too little, not because everyone does not want to write the library, but it is difficult to write. STL is a standard template library of C V, which has a lot of classic algorithms, plus template-based, suitable for multiple data types, some extent is a general algorithm, so it is in C High status.

The meaning of STL is that it provides us with a lot of good "parts", we can use it to develop our own "car"!

And "parts" manufactured by STL is so good (spatial efficiency and time efficiency are very good, how can it be c

Incorporate it into the standard, huh, huh, it is not some domestic goods (huh, there is no BS domestic meaning, but national enterprises

Industry still needs efforts! )

The meaning of studying STL is that it provides us with a lot of very good "parts", we can use it to develop its own "car"!

And "parts" manufactured by STL is so good (spatial efficiency and time efficiency are very good, how can it be c

Incorporate it into the standard, huh, huh, it is not some domestic goods (huh, there is no BS domestic meaning, but national enterprises

Industry still needs efforts! )

Learning C does not learn STL (now the standard library may be better, the latter has improved STL, should be considered STL's super-collection), will certainly regret, but now many schools don't know, when school teaches C , Did not mention STL

Do not learn STL (now the standard library may be better, the latter has improved to STL, should be considered STL's super-collection), will certainly regret, but now many schools don't know, when school teaches C , there is no mention STL

And I think that C library is difficult to write, and the implementation of C standards in various compiler vendors is not uniform!

For example, Microsoft may write some of its own libraries in order to sell its own C compiler, but for commercial purposes of these libraries.

The C compiler got Borland is not necessarily easy to use! The same thing can also happen to Borland to Microsofe!

This causes inconvenience in the library ~

Compare C , Java is doing, in fact, Java is so successful with Java rich libraries, Java standard

Since Sun (a strong commercial company), the JVM strictly implements Sun's Java standard, so all Java development

The library can be very convenient to perform on various versions of JVM so that we are very convenient to use the library ~

C except STL and some other open source libraries, these things provide great convenience for our development.

Let the programmer can put more experiences into the implementation of the software without having to spend too much energy on the language and algorithms.

STL is largely = Vector Basic_Stream Basic_String

Wild programming started by STL

For the lazy people like me, there is nothing else, it is convenient, such as:

#include

#include

#include

Int main (void)

{

Using namespace std;

Typedef Map word_count_t;

Word_count_t wc;

String word;

While (CIN >> Word) {

wc [word];

}

Word_count_t :: const_iterator 特r;

For (ITR = wc.begin (); itr! = wc.end (); iTr) {

COUT << ITR-> first << "<< ITR-> second << endl;

}

}

In this way, you can count the frequency of the words in each word, the efficiency is not good.

Sometimes it is asking too much, but it will lose something that really needs.

The greatness of STL is not only there there to provide a lot of commonly used data structures and many classic algorithms, but also because he provides iterators: You can use iteratory concepts, write your own iterator, and some data structures written by GP, It can be used very well; and he can let you expand your library and use it well with existing libraries.

转载请注明原文地址:https://www.9cbs.com/read-130535.html

New Post(0)