I know how to get the bit count of a cpu or an operation system with shell.
cat /proc/cpuinfo | grep lm #-> get bit count of a cpu
uname -a #-> get bit count of an operation system
However, how can we get the bit count of those in a C program. This is an interview question and my solution is as follow:
int *ptr;
printf("%d\n", sizeof(ptr)*8);
But the interviewer said that was wrong. So, what is the correct answer?