B
Bryan Parkoff
int has two bytes or four bytes. long has four bytes or eight bytes. I
can't be sure to choose int or long keyword because I don't trust to get the
wrong size. I always check by using sizeof(...).
I always use "short int" to show two bytes and "long int" to show four
bytes. It may not be accurate when I port my code from Microsoft C/C++
Compiler to other C/C++ Compiler such as Linux, Unix, Mac, etc. I always
trust Microsoft's keyword such as __int8, __int16, __int32, and __int64, but
I try to work around int and long keywords.
Someone does not recommend to use C/C++ Compiler's keywords so they
recommend to use typedef such as char to CHAR, bool to BOOL, etc. Why can't
programmers prefer BOOL instead of bool? Which it is important to have one
byte for bool and four bytes for BOOL?
If my code is written to use 64 bits CPU arch, it would be "long long"
to handle 8 bytes.
Please advise.
Bryan Parkoff
can't be sure to choose int or long keyword because I don't trust to get the
wrong size. I always check by using sizeof(...).
I always use "short int" to show two bytes and "long int" to show four
bytes. It may not be accurate when I port my code from Microsoft C/C++
Compiler to other C/C++ Compiler such as Linux, Unix, Mac, etc. I always
trust Microsoft's keyword such as __int8, __int16, __int32, and __int64, but
I try to work around int and long keywords.
Someone does not recommend to use C/C++ Compiler's keywords so they
recommend to use typedef such as char to CHAR, bool to BOOL, etc. Why can't
programmers prefer BOOL instead of bool? Which it is important to have one
byte for bool and four bytes for BOOL?
If my code is written to use 64 bits CPU arch, it would be "long long"
to handle 8 bytes.
Please advise.
Bryan Parkoff