How to identity processor architecture

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dear,

I just wanna to know my processor architecture(32bit or 64 bit) through 
c programming.

According to me the sizeof of pointer will give the result. Like below 
coding.

int main()
{
int *ptr;
printf("%d",sizeof(ptr));
}

If the result is 4 then it is 32 bit processor... If it is 8 then it is 
64 bit processor.

Please correct me if i am wrong... (I do not have system to check this.)

Any suggestion or help would be appreciated.

Thanks,
Prabhu

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux