C和C++中未定义,未指定和实现定义的行为有什么区别?
c c++ undefined-behavior unspecified-behavior implementation-defined-behavior
在这种情况下,我遇到了一些问题,请您提出您的想法。
main()
{
char *p=NULL;
p=(char *)malloc(2000 * sizeof(char));
printf("size of p = %d\n",sizeof (p));
}
Run Code Online (Sandbox Code Playgroud)
在此程序中,它打印4那个(char *)值,但是我需要为此分配多少字节。