include library loads all or just components used, in the resulting binary? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

include library loads all or just components used, in the resulting binary?

7th Aug 2019, 6:10 AM
BinaryEden
BinaryEden - avatar
5 Answers
+ 1
If you include all, it loads all. That is why you need to be specific of the library needed in your code before you include it.
7th Aug 2019, 6:22 AM
Franky BrainBox
Franky BrainBox - avatar
0
franky how can include just what u need?
7th Aug 2019, 6:23 AM
BinaryEden
BinaryEden - avatar
0
For example... In your code, you are using a string data type. string my Name = '' Eden '' ; It is sure that you will need to include the string.. #include <string> Or let's say, you are using a math function in your code, you will need to include the math library to perform maths functions in your code. #include <cmath> NB: when you code in a compiler, you will get some red underlined flag on restricted words if you don't include their libraries. So you hand pick those flags then include their libraries to remove the red underlined flags.
7th Aug 2019, 6:31 AM
Franky BrainBox
Franky BrainBox - avatar
0
i know all that, my question is if there is some way to include just the functionality you are using from a library instead of all the library
7th Aug 2019, 7:01 AM
BinaryEden
BinaryEden - avatar
0
I understand you now. Well, Anything is possible but to me, I have never seen it done before. You will have to include the library to have access to every component in it. Have you ever tried opening an include file? It possibly looks like a class... Just saying
7th Aug 2019, 7:13 AM
Franky BrainBox
Franky BrainBox - avatar