我无法在Firefox上激活Twitter网络通知,您可以在下面的屏幕截图中看到
我不明白为什么这个简单的代码不会在 linux 上导致分段错误的情况下运行:
#include <stdlib.h>
struct entry
{
int value;
};
void initEntry(struct entry *entry)
{
entry = malloc(sizeof(struct entry));
entry->value = 0;
}
int main()
{
struct entry *list;
initEntry(list);
list->value = 5;
}
Run Code Online (Sandbox Code Playgroud)
删除最后一条指令后我可以运行程序 ( list->value = 5;
)
我编译:
gcc main.c -o main
Run Code Online (Sandbox Code Playgroud)