Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is C++ considered weakly typed? Why?

Tags:

People also ask

Is C weakly typed or strongly typed?

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.

Why is C considered a strongly typed language?

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.

Why are C and C++ not strongly typed?

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.

What language is weakly typed?

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?