There are two files. Both are in the root folder. The first:
#include "pch.h" #include <iostream> using namespace std; void g(); int main() { g(); } Second:
void g() { cout << 4; } Actually, why the g () function was called in main (). Initially, I thought that the main function would be able to learn about the implementation of g () only if I set up #include "add.cpp" but on the site where I am learning it says that it is better not to write this line and use the code I quoted above. It turns out the compiler automatically checks implementation in the files lying in a root?