curses.h

hi all

i get a segmentation fault error in the following program. couldn't understand why it happens. can anyone explain what is really happening.

s1.c
#include<curses.h>
main(){
int c;
noecho();
cbreak();
c=getch();
printf("%c",(char)c);
}

I compiled this program as
cc s1.c -lcurses. compilation is successful. But during run time it gives core dump error.

thanx

You need to call initscr() to set everything up.

you could have tried atleast once,

try this very small example !!! :slight_smile: :slight_smile:

search the forum