C is considered statically typed (you can't have a variable change from int to float). Once a variable is declared it is stuck that way.
But it is considered weakly typed because the types can be flip flopped.
What is 0? '\0', FALSE, 0.0, etc..
in many languages you can't say IF (variable) because conditions will only take boolean values from boolean expressions. These are more strongly typed. The same applies to going between characters and integers.
basically c has two main simple data types, integers and floating point numbers (though various precisions). Everything else booleans, enums (not simple but it fits), etc. are implemented as one of those. Even characters are basically integers.
Compare to other languages where there are string types, enum types that can only be assigned to the defined values, boolean types where only expressions that generate booleans or true/false can be used.
But you can argue that compared to Perl C is strongly typed. So it is one of those famous arguments (vi vs emacs, linux vs windows, etc.). C# is stronger typed than C. Basically you can argue either way. And your answers will probably go both ways :) Also some textbooks/web pages will say C is weakly typed, and some will say C is strongly typed. If you go to wikipedia the C entry says "partially weak typing". I would say compared to Python C is weakly typed. So Python/C#, C, Perl on the continuum.
C++ programming is based on strong static type checking, and most techniques aim at achieving a high level of abstraction and a direct representation of the programmer’s ideas.
, I feel that C++ should be taken out of the Wikipedia sentence. – OrthiconC
andC++
arestrongly typed
languages with loopholes in their type systems. – Stichometry