In C/C++ each library has its own data types for primitive types. For example:
byte, word64, DWORD, LWORD, uint, unsigned int, size_t, ...
However in high-level languages such as Java and C#, everything is uniform (across all libraries).
In C/C++ programming, [beginner] people really get confused which data type should they use. For example, byte
is defined as unsigned char
, so why do we need byte
at all?
I think this could be a source for many memory leaks and other problems (such as many vulnerabilities) at least for beginners. I still can't figure out what's the point of having such data types while a minimal set of them is enough?
The same problem is for null
pointer as we have:
NULL, 0, _null, ...
And all are defined as 0
.
Update #1:
As @CoryKramer stated the reason could be because of cross-platform compatibility, and interoperability. So, another question which comes to my mind, is that why don't standards define a uniform, cross-platform and inter-operable data types?