Question:
C and C++ standard library?
botgeek
2007-03-05 20:06:26 UTC
Are the function implementations in the standard library already in object code or are they in source code that must be loaded before the compiler runs so that they can be compiled.
Five answers:
2007-03-05 20:47:49 UTC
The standard libraries are created by only the object code. By the object code we can create our own header files also. It is for reducing our code complexity. For using the header files with our programmer, the object code is enough. and also for become to usage of header files only the object code is loaded. That's it.
TOB
2007-03-05 20:44:13 UTC
Hi there. I'm not sure what you mean by "already in object code"... if by "object" you are referring to the executable file generated by the compiler and NOT the object-oriented version of "object", then the answer is no, because there before compiling, there IS no object file. If you mean the object-oriented version of "object", then I'm not even sure what your question means.



When you do a #include , you are telling the compiler to look for a library matching the name you provided, and to include the functions contained within that library in the compiled code. So the answer to the 2nd alternative you provide ("are they in source code that must be loaded before the compiler runs") is yes. After the compiler runs, you will have an executable object file that does include the standard library functions.
csanon
2007-03-05 22:02:26 UTC
Taher is clueless, TOB has no idea what he is talking about, and sridhar is hard to understand, but I think he has it right.



So, the standard library is precompiled into binary. Whenever you compile your program, you do NOT recompile the standard library source. Whoever made your compiler has compiled the C/C++ runtime libraries and various library files for the different aspects of the standard library. So whenever your code uses something in those libraries, they get appropriately linked in.
chesire
2016-12-05 12:34:55 UTC
C++ STL includes some products no longer modern-day in C commonly used Library, alongside with iostream, string for string gadgets, assorted boxes like vector, record etc., and exception. C++ STL also includes some products that are right now copied from C commonly used Library, alongside with cstdio (stdio.h), cmath, cstdlib, etc. i do not understand of any C commonly used Library products that are literally not in C++ STL, besides the undeniable fact that it truly is no longer truly threat-free to assert it truly is only a sub-set. There do exist C efficient factors no longer in C++, so it will be an identical with the libraries. yet maximum of it truly is easily protected. C is truly so a lot more suitable lax about jointly with headers for commonly used library purposes. see you later as a function returns an "int" variety, there is not any compiler mistakes for utilizing a function without jointly with its prototype. or maybe in circumstances the position it truly is no longer "int", in case you ignore with reference to the go back cost, no mistakes will ensue. yet C++ is a lot more suitable strict. in case you employ a function, even a common library function, you are able to grant a prototype, usually in type of jointly with the header document for that function.
taher
2007-03-05 20:32:24 UTC
C++ standard library is very good

try to use that


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