The relationship between the programming language and the OS API

there are methods in a programming language in C ++, for example

cout<<"hello world".

When compiling, it calls a system call to do the actual work OR , is it compiled directly into binary code and executed by the executable kernel?

if it uses API OS, different platforms using different API APIs, how can the language be the same?

+3
source share
2 answers

ok in the simplest terms that I can think of.

, , , . , API. . api ( ). API- . , OS API , , .

Ok :

cout << "hello world";

. , , , OS api (, WriteStringToConsole), , , , . . . , , , - .

, - , . , MS DOS . WINDOWS , , .., , .

. , stanard. NOte, , (, , , ).

- API . API (), , . /API .. , . , API-, , .

: . , . Linker . - , , , . , , .

, stanard, -, , . , , many . , -, , , .

+3

C\++ , COMPILE, java, run. , , cout\printf\puts .., , dll\so, obj\a ( , , ( )). (VS\gcc), , .

+1

Source: https://habr.com/ru/post/1769720/


All Articles