Return to BSD News archive
Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mel.connect.com.au!munnari.OZ.AU!news.ecn.uoknor.edu!news.wildstar.net!news.sdsmt.edu!news.mid.net!newsfeeder.gi.net!newsfeed.internetmci.com!news.kei.com!nntp.coast.net!torn!ccshst05.uoguelph.ca!ccshst01!bbeharry
From: bbeharry@uoguelph.ca (Brian Beharry)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Please debug these 18 lines of code?
Date: 15 May 1996 12:47:15 GMT
Organization: University of Guelph
Lines: 29
Message-ID: <4ncjoj$oab@ccshst05.uoguelph.ca>
NNTP-Posting-Host: ccshst01.uoguelph.ca
X-Newsreader: TIN [version 1.2 PL2]
I'm having trouble running the program at the end of this message. The
program creates a 3X10 curses window on row 4 and column 11(relative to the
screen) and then tries to make a 1X8 subwindow inside of it. As soon as I try
to make the subwindow, it gives a segmentation fault--Why?
Thanks in advance! :)
#include <curses.h>
int main(void)
{
WINDOW *Error = NULL;
WINDOW *SubError = NULL;
initscr();
Error = newwin(3, 10, 4, 11);
box(Error , '+', '+');
wrefresh( Error );
SubError = subwin(Error, 1, 8, 5, 12); /* <-- It dies here. :( */
waddch( SubError, 'X');
wrefresh( SubError );
endwin();
} /* End of main */
______________________________________________________________________________
From: Brian Beharry
E-mail: bbeharry@uoguelph.ca