Code Comments
Programming Forum and web based access to our favorite programming groups.In my main function I first declare a few variables and I then call
these functions:
initscr();
noecho();
cbreak();
keypad(stdscr, TRUE);
refresh();
I then draw a few horizontal and vertical lines on the "standard
screen".
Next I make a window:
new_win = newwin(5, 5, 20, 15);
box(new_win, 0, 0);
wrefresh(new_win);
Infinite loop and switch
while (1) {
ch = getch();
printw("1");
switch(ch) {
case KEY_LEFT: ....
....
It compiles without any problems. When I execute it draws the vertical
and horizontal lines and displays the window. As soon as I press the
left arrow key I get: Segmentation fault
It never prints the 1.
Post Follow-up to this messagesubflood <PawelB.lnx@gmail.com> wrote: > In my main function I first declare a few variables and I then call > these functions: you left something out, but there's not enough information to guess what. -- Thomas E. Dickey http://invisible-island.net ftp://invisible-island.net
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.