Hi,
I'm using menu library of ncurses library for development of a tool. While
executing a
program segmentation fault is coming, and core dumped. After several checks
I'm not able to find the bug. I'm running on RedHat Linux 6.2 and SuSE
Linux.
In the following program while execution of the instruction
menu[0] = new_menu(myitem);
segmentation fault is coming...
Program:
------------------------------------------------
#include<menu.h>
#include<stdlib.h>
#include<stdio.h>
main(){
char respo[10], act[10];
int res;
ITEM * myitem[2];
MENU * menu[1];
if((myitem[0] = new_item("Menu", "love")) == NULL ){
printf("\n Error on new item");
exit(1);
}
if((myitem[1] = new_item("Menu-2nd", "love")) == NULL ){
printf("\n Error on 2nd new item");
exit(1);
}
initscr(); /* Initilise the Curses*/
menu[0] = new_menu(myitem); / * Here segmentation fault is coming......core
dumped*/
printf("\n \t Response of new menu is:%d", menu);
getchar();
res = post_menu(menu[0]);
if(res != E_OK){
sprintf(respo, "Response of post is: %d", res);
addstr(respo);
move(5,35);
addstr(act);
}
refresh();
getch();
endwin();
}
--------------------------------------------------------
compiled with -lmenu and -lncurses libraries.
can anyone help me out.....?
Thanks in advance,
Nitin
Follow-Ups:
- [fol] Re: "ncurses"--help needed......tesigana _at_ mtf.biglobe.ne.jp
- [fol] Re: "ncurses"--help needed......Taketoshi Sano
- Prev by Date: [fol] Re: 「ブートに関しての8GBの壁」は突破できるか
- Next by Date: [fol] ,C.A-B`L`E, .B-O`X` ;D`E`S,C;R,A.MB;L,E.R- S,E.E; A-L`L` `T`H`E` `CH-A;NN.EL,,S;;,,,;,,,,;,,;, 2248
- Previous by thread: [fol] Re: 「ブートに関しての8GBの壁」は突破できるか
- Next by thread: [fol] Re: "ncurses"--help needed......
- Indexes:[Main][Thread]