这听起来可能很老派,但我仍然无法弄清楚为什么以下程序会抛出段错误。任何帮助都会很棒
#include <stdio.h>
pointer(char **x)
{
printf ("Before %c",*x[0]);
*x[0] = 'a'; // segmentation fault here!!
printf ("After %c", *x[0]);
}
int main()
{
char *x = "Hello";
pointer(&x);
}
最佳答案
关于c - C 中指向指针的指针抛出段错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25273184/