STL Unit 1 String container

1. string container 1.1 string concept Essence: String is a C + + style string, and string is essentially a class. The difference between string and char *: Char * is a pointer, string is a class, and char * is encapsulated inside the class. Managing this string is a char * type container. string manages the memory allocated by char *. The ...

Posted by redbrad0 on Fri, 17 Sep 2021 22:49:56 -0700

Use and Simulation of stack and queue

1, stack introduction template <class T, class Container = deque<T> > class stack; (1). stack is a container adapter, which is specially used in the context with last in first out operation. Its deletion can only insert and extract elements from one end of the container. (2) Stack is implemented as a container adapter. The c ...

Posted by gotit on Fri, 17 Sep 2021 20:10:18 -0700

stable_sort user defined comparison function stepping pit (shallow understanding)

1. General "A good memory is better than a bad pen". This article is the first article of "difficult and miscellaneous diseases encountered". This article mainly introduces the STL stable encountered in today's work_ The problem of custom comparison function of sort algorithm is only a superficial introduction. The specific ...

Posted by Lokolo on Wed, 01 Sep 2021 22:26:07 -0700