我的练习遇到了问题,我必须解释 C 中指针的运行。
您能向我解释一下char *pp和之间的区别吗?(char*) p
#include <stdio.h>
#include <stdlib.h>
/*
*
*/
int main(int argc, char** argv) {
int n=260, *p=&n;
printf("n=%d\n", n);
char *pp=(char*)p;
*pp=0;
printf("n=%d\n",n);
return (EXIT_SUCCESS);
}
Run Code Online (Sandbox Code Playgroud)
n=260
n=256
我对我所犯下的错误感到非常抱歉!希望你们能帮助我。
c ×1