Question:
C Standard Library vs C++ STL?
achilles
2012-05-23 14:50:04 UTC
Is the Standard Template Library the same as the C Standard Library but for C++?
Four answers:
Cubbi
2012-05-23 20:04:18 UTC
No, not at all.



"Standard Template Library" was a library in the 90s, which has been abandoned at least a decade ago. It is notable for influencing the design of the early C++ standard library, to such degree that a part of the C++ standard library essentially mimics the interface of a part (not all) of STL.



However, the C++ standard library is much much more than just the parts inspired by the STL. Today, there's more in the library that was inspired by Boost than what was inspired by STL.



Based on your usage, I suspect that you're misusing the word "STL" to refer to the entire C++ standard library (which is a common error, made by many unofficial sources). In that case, the answer is yes. Both languages (C and C++) are defined in terms of core language and standard library.
Unca Alby
2012-05-23 16:57:57 UTC
C++ STL includes some items not found in C Standard Library, such as , for string objects, various containers like , etc., and .



C++ STL also includes some items that are directly copied from C Standard Library, such as (stdio.h), , , etc.



I don't know of any C Standard Library items that are not in C++ STL, but it's not quite safe to say it's simply a sub-set. There do exist C features not in C++, so it may be the same with the libraries. But most of it is certainly included.



C is quite a bit more lax about including headers for standard library functions. So long as a function returns an "int" type, there is no compiler error for using a function without including its prototype. And even in cases where it's not "int", if you ignore the return value, no error will occur.



But C++ is much more strict. If you use a function, even a standard library function, you must provide a prototype, usually in form of including the header file for that function.
attebery
2016-10-24 15:00:18 UTC
KC and STL are both fairly undesirable, terrible, and unhappy communities. yet Washington is larger than Oakland, Chris Cooley receives extra passes his way and has also shown he can score. till Zach Miller does something of fee, keep on with what you recognize works. MY VOTE: Cooley
FatalBreak
2012-05-23 15:30:10 UTC
I beleive so. maybe a few extras.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...