I'm trying to find the size of integer without using sizeof function. I wrote something like this but it doesn't work properly. It outputs 1. Please correct me. Here is my code.
int intSize() {
int intArray[10];
int *intPtr1;
int *intPtr2;
intPtr1 = intArray;
intPtr2 = intPtr1 + 1;
return intPtr2-intPtr1;
}
See Question&Answers more detail:os