问题
In this program I have located char pointer. I have located 1 byte of memory in heap. But when I print its size it shows 4 bytes. please help.
//CODES//
#include <stdio.h>
#include <stdlib.h>
int main(){
char *ptr;
ptr=(char*)malloc(1);
printf("The size is %d.",sizeof(ptr));
}
来源:https://stackoverflow.com/questions/64962528/why-does-it-prints-that-the-size-of-char-is-4-byte