How does he get Log() function without including it??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How does he get Log() function without including it???

i cant be realized what happen during 4:40 and 5:30 times in below mentioned tutorial video of Cherno? Pleace someone explain me what happened there??? https://youtu.be/H4s55GgAg0I

4th Nov 2022, 7:41 PM
Dilip ishara
Dilip ishara - avatar
1 Answer
+ 2
Dilip ishara when he removes the Log() function definition out from the main source file and into an external file the main file fails to compile. Log() is undefined within the scope of the main file. He adds a function prototype of Log() into the main file and then it compiles. It works because the compiler only needs to know what parameters the function expects on the stack. The linker fills in the missing detail of the function address. Most included library header files contain mere function prototypes, not the actual function. The function would have been already compiled into an object library file (e.g., .obj) that is brought in by the linker. [There are also dynamically linked library files (.dll) that are brought in during run time.] Does that help clarify what happened?
5th Nov 2022, 6:42 AM
Brian
Brian - avatar