C is statically but weakly typed: The weakly type system allows some freedom for speed improvements and allows to handle the memory at a low level. It is thus perfectly fine to use it when you know what you are doing, for tasks where the memory footprint and speed are important.
A programming language that requires a variable to be defined, and the variable it is. For example, C is a strongly typed language. When declaring the variable, you must also specify the variable type.
C and C++ are considered weakly typed since, due to type-casting, one can interpret a field of a structure that was an integer as a pointer.
Weak Typing For instance, JavaScript is an example of weakly typed language. The implication is that operations between variables of different data types are legal.
I've always considered C++ to be one of the most strongly typed languages out there.
So I was quite shocked to see Table 3 of this paper state that C++ is weakly typed.
Apparently,
C and C++ are considered weakly typed since, due to type-casting, one can interpret a field of a structure that was an integer as a pointer.
Is the existence of type casting all that matters? Does the explicit-ness of such casts not matter?
More generally, is it really generally accepted that C++ is weakly typed? Why?
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