TITLE: difference between and (Newsgroups: comp.lang.c++, 17 Sep 98) KRYUKOV: Anton Kryukov > > My undersdanding is that string IS a part of STL, defined something > like > > typedef basic_string string; BECKER: Pete Becker basic_string and string are part of the C++ Standard Library. The C++ Standard Library in turn consists of the language support library, the diagnostics library, the general utilities library, the strings library, the localization library, the containers library, the iterators library, the algorithms library, the numerics library, and the input/output library. STL was incorporated into the C++ Standard Library, primarily in the containers, iterators, and algorithms libraries. The strings library is not part of STL. KRYUKOV: > > And the main difference between #include and > #include is that the former puts all the declarations in > global scope. BECKER: No. There are C headers and there are C++ headers. When you #include a C header you get the C header. When you #include a header whose name is the letter 'c' followed by the name of a C header without the .h you get the C++ version of that header. When you #include a standard header whose name has no extension you're getting a purely C++ header. #include /* pulls in the C header 'string.h' */ #include /* pulls in the C++ version of the C header 'string.h' */ #include /* pulls in the C header 'string' */ The first two pull in the same names, but the first one puts them all in the global namespace and the second puts them all in namespace std. In either case you get the names of the standard C string handling functions like strlen, strcat, etc. The third pulls in the C++ string names, things like basic_string, string, etc.