I am bored with the skill assessment conducted by the company today! There is actually a problem that can be called antique: How to Use the C ++ program to view the number of digits of the Operating System (16-or 32-bit), not the sizeof () function
This problem itself seems to be a very complicated problem. I personally think it should be a very profound problem for the program to view the number of digits in the operating system, there should be corresponding API functions in windows. I don't know how compilers of different versions handle this problem.
Source code on my questions:
# Include <iostream>
# Include <iomanip>
Using namespace STD;
Int main (void)
{
Unsigned int A = 1;
A = ~ A;
Cout Int COUNT = 0;
While ()
{
A = A/2;
Count ++;
}
If (count> 16)
{
Cout <"32 bits OS" <Endl;
}
Else
{
Cout <"16 bits OS" <Endl;
}
Return 0;
}