Hi Enrico,
I am not sure.
No, because 32bit code will tell the datatype size and i think pointer
variable depends on architecture.
So 64 bit processor needs 64 address line to point the data location.
So pointer variable needs to be 8 byte.
please correct me if i am worng.
Thanks,
Prabhu
Enrico Granata wrote:
What if one is compiling 32bit code on a 64bit processor? Would
4 be an acceptable result to you in that case?
Computer Science & Engineering Department (EBU3B) - Room
3240
office phone 858 534 9914
University of California, San Diego
On Jan 26, 2011, at 10:07 PM, prabhu wrote:
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));
}
Please correct me if i am wrong...
Any suggestion or help would be appreciated.
Thanks,
Prabhu
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
|
_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies