I
Immortal Nephi
I always use unsigned int to do math calculation or algorithm. The
int size was either 16 bit or 32 bit on older machine and older C++
Compiler. Today, int size is either 32 bit or 64 bit. The int size
is not important to me when math calculation or algorithm in my C++
code is performed maximum 16 bit. It does have enough room to either
int 32 bit or int 64 bit without 16 bit overflow.
My C++ code can be ported to any C++ Compiler on depend of different
machines. If I choose int 64 bit to do math calculation or algorithm,
how do I tell C++ Compiler to use int 64 bit instead of int 32 bit
with the answer -- sizeof? I do not have to remodify int size in all
header files and source code files.
Same example, char is always 8 bit, but one machine may have 9 bit or
10 bit width. To create string array in memory, each element is
always 8 bit. If 9 bit or 10 bit width is detected, then I must
accommodate to put 9 bit or 10 bit string array into 16 bit string
array.
int size was either 16 bit or 32 bit on older machine and older C++
Compiler. Today, int size is either 32 bit or 64 bit. The int size
is not important to me when math calculation or algorithm in my C++
code is performed maximum 16 bit. It does have enough room to either
int 32 bit or int 64 bit without 16 bit overflow.
My C++ code can be ported to any C++ Compiler on depend of different
machines. If I choose int 64 bit to do math calculation or algorithm,
how do I tell C++ Compiler to use int 64 bit instead of int 32 bit
with the answer -- sizeof? I do not have to remodify int size in all
header files and source code files.
Same example, char is always 8 bit, but one machine may have 9 bit or
10 bit width. To create string array in memory, each element is
always 8 bit. If 9 bit or 10 bit width is detected, then I must
accommodate to put 9 bit or 10 bit string array into 16 bit string
array.