3 ms·
Your example of needing to define a type because "int" is not good enough is very C/C++ centric. Most languages don't have the plethora of integer types that C
by jokerx 8y ago
Your example of needing to define a type because "int" is not good enough is very C/C++ centric.
Most languages don't have the plethora of integer types that C has. Java, for example, has just has 2 in general use: int (signed 32 bit) and long (signed 64 bit). (Nobody considers byte a general integer type.)
In C/C++, you have to define so many things about the types you use because so much is "implementation dependent." So for C/C++, you may be correct. Most other languages define their types more stringently and include a smaller number of general purpose types.
- scarface74 8y agoC# has nine integral types. https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/integral-types-table https://docs.microsoft.com/en-us/dotnet/csharp/language-refe... But even then, a year is an int, but it would have certain semantics you would want to enforce outside of integers.