If type of the value cannot be analyzed or found out by looking into the bits(As written in books I have referred), how does the machine know how the value should be manipulated?
C and C++ are statically typed, meaning that types are a compile-time concept. The compiler generates code to manipulate the bits in a manner appropriate to the type; the machine executes that code, and doesn't need to know anything about the type.
The compiler knows the type of every variable because you must declare each type. So the compiler generates the appropriate instructions for dealing with a variable of any particular type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With