If the type of value cannot be analyzed by searching in bits, how does the machine know how to manipulate the value?

If the type of the value cannot be analyzed or detected by searching in bits (as written in the books I mentioned), how does the machine know how to manipulate the value?

+4
source share
5 answers

C and C ++ are statically typed, which means that types are a compile-time concept. The compiler generates code to manipulate bits in a manner appropriate to the type; the machine executes this code, and it does not need to know anything about the type.

+12
source

, . , .

+8

: , . .

+5

C ++ . , , MULTIPLY REAL MULTIPLY UNSIGNED INTEGER MULTIPLY SIGNED INTEGER. , *, - , .

+2

It is known to the compiler at compile time. When the program starts, this memory area is controlled according to the compiled code. This is why C ++ and C # define type types in the source code.

+2
source

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


All Articles