i have to detect the type of CPU.
whether it is 32-bit or 64-bit..
how can this be done..
An N-bit CPU architecture is an *ADVERTISING* and *MARKETING*
concept. It can change with no physical change in the CPU, and it
can change before the CPU is even built.
What is it you think is indicated by "this CPU has an N-bit
architecture", and why do you need to know?
1. This CPU uses N bits for char.
2. This CPU uses N bits for int.
3. This CPU uses N bits for long.
4. This CPU uses N bits for long long.
5. This CPU uses N bits for pointers.
6. This CPU uses an N-bit-wide memory bus.
These won't necessarily occur together.
#1 won't happen very often, especially on desktop computers or servers,
as opposed to embedded processors.
#6 is likely detectable from software only by measuring performance,
and possibly not even then, unless software can read the invoice for
the purchase of the system.
#4 is unlikely to indicate much as lots of machines provide a 64-bit long
long with multiple-precision arithmetic, even on machines arguably of
16/32 bit architecture.
I think the most likely meaning of "64-bit architecture" is that
*POINTERS* are 64 bits, so no nasty 4GB addressing space limit.
There is no agreement on that.