小编dai*_*eul的帖子

Twitter浏览器通知不受支持

我无法在Firefox上激活Twitter网络通知,您可以在下面的屏幕截图中看到

Twitter设置截图

twitter firefox push-notification libnotify archlinux

1
推荐指数
1
解决办法
2185
查看次数

使用 malloc 和 struct 出现分段错误(核心转储)

我不明白为什么这个简单的代码不会在 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)

c linux malloc struct

0
推荐指数
1
解决办法
916
查看次数

标签 统计

archlinux ×1

c ×1

firefox ×1

libnotify ×1

linux ×1

malloc ×1

push-notification ×1

struct ×1

twitter ×1