I am curious to see how the cout function was written, where should i look for it?
cout
is not a function. You mean one of the operator<<
member or non-member functions for output streams.
Anyway, even though the C++ standard does not mandate files for standard-library headers, those functions are usually implemented in terms of the language itself and reside in files that come with your compiler. For example, on my Windows system there's a file called C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\iostream
, which the Visual C++ compiler uses to process a line like #include <iostream>
in user code.
Expect to see a lot of non-standard, hard-to-read, macro-infested and undocumented internal pseudo-C++ in those files.
My second question is, can i really dissect every component of the language in order to understand it?
Only if the compiler is open source, for example GCC but not Visual C++, and only if you understand enough about compiler writing.
For example, can i see how the compiler read the operators?
Only if the compiler is open source, for example GCC but not Visual C++, and only if you understand enough about compiler writing.
Even if its in machine code, how do i find myself in it ?
Find out how to view the disassembly on your system and with your tools.