Date: Thu, 28 Aug 2008 00:46:00 -0400 From: Daniel Molina Wegener <dmw@unete.cl> To: freebsd-questions@freebsd.org, Christopher Joyner <chris27wjoyner@gmail.com> Cc: questions@freebsd.org Subject: Re: curses.h, beep() returns ERR, flash() casuses segment fault. Message-ID: <200808280046.13657.dmw@unete.cl> In-Reply-To: <898452.32176.qm@web56714.mail.re3.yahoo.com> References: <898452.32176.qm@web56714.mail.re3.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart1822109.xeQlmOYend Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Wednesday 27 August 2008 22:10:40 Christopher Joyner wrote: > I do not get the OK from beep, and flash crashes the program. > This is my code: First, take a look on the manual page... =20 > > #include <curses.h> > > int main(int argc,char** argv) > { > if(beep()!=3DOK) > printf("No OK\n"); fflush(stdout); > if(flash()!=3DOK) > printf("No Flash\n"); fflush(stdout); > return 0; > } Well, try: #include <stdlib.h> #include <stdio.h> #include <curses.h> int main(int argc,char** argv) { /* in curses(3X) manual page... */ initscr(); if (beep() !=3D OK) printf("No OK\n"); fflush(stdout); if (flash() !=3D OK) printf("No Flash\n"); fflush(stdout); return 0; } And read the curses manual page, you forgot to init the screen. > > > > In Love in Jesus Christ, Or Lord and Savior. > > > For God so loved the world, that he gave his only *begotten > Son, that whosoever believeth in him should not perish, but > have everlasting life. --John 3:16 > > > [SNIP] Regards, =2D-=20 .O. | Daniel Molina Wegener | C/C++ Developer ..O | dmw [at] unete [dot] cl | FOSS Coding Adict OOO | FreeBSD & Linux User | Standards Rocks! --nextPart1822109.xeQlmOYend Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (FreeBSD) iEYEABECAAYFAki2LYkACgkQbvV0HEsGCMTIlwCgl+RkdIMOuoPhqK30vUt34FF2 974An3Wz41G7+NZZbEMSx92xdI2gsPRv =vEOZ -----END PGP SIGNATURE----- --nextPart1822109.xeQlmOYend--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200808280046.13657.dmw>