为什么使用“ dialog_checklist”时,为什么会得到细分错误。来自linux's&quot diarog.h'&quot?
我想从对话框
linux软件包中使用dialog.h
库过错。我认为这与字符串列表有关(char **),但我找不到解决方案。
在第10行上的此代码中,发生错误:
#include <dialog.h>
int main() {
int distro;
char dist1[] = "Ubuntu";
char dist2[] = "Gentoo";
char *distros[2] = {dist1,dist2};
init_dialog(stdin, stdout); // start dialog
distro = dialog_checklist("Select Distro","Select One",0,0,0,2,distros,1);
end_dialog(); // end dialog
}
Incase任何人都需要它:对话的人页面。H
I wanted to use the dialog.h
library from the dialog
Linux package but when I try to make a radiolist (checklist with flag parameter set to 1) it gives me a segmentation fault. I assume it has to do with the list of strings (char**) but I have been unable to find a fix for it.
In this code on line 10 the error occurs:
#include <dialog.h>
int main() {
int distro;
char dist1[] = "Ubuntu";
char dist2[] = "Gentoo";
char *distros[2] = {dist1,dist2};
init_dialog(stdin, stdout); // start dialog
distro = dialog_checklist("Select Distro","Select One",0,0,0,2,distros,1);
end_dialog(); // end dialog
}
Incase anyone needs it: man page for dialog.h
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来我读了错误的文档,该列表应该包含每个项目的{标签,项目,状态}。
It appears I read the documentation wrong, the list was supposed to contain {tag, item, status} for each item.