From owner-freebsd-questions@FreeBSD.ORG Thu Aug 28 04:48:29 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 801901065677 for ; Thu, 28 Aug 2008 04:48:29 +0000 (UTC) (envelope-from dmw@unete.cl) Received: from mail01.ifxnetworks.com (mail01.ifxnetworks.com [190.61.128.51]) by mx1.freebsd.org (Postfix) with ESMTP id 22ADE8FC18 for ; Thu, 28 Aug 2008 04:48:29 +0000 (UTC) (envelope-from dmw@unete.cl) Received: (qmail 11703 invoked from network); 28 Aug 2008 04:48:28 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail01.ifxnetworks.com X-Spam-Level: X-Spam-Status: No, score=0.1 required=7.0 tests=RDNS_NONE autolearn=disabled version=3.2.5 Received: from unknown (HELO quake) (dmw@unete.cl@[200.73.29.99]) (envelope-sender ) by mail01.ifxnetworks.com (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 28 Aug 2008 04:48:27 -0000 From: Daniel Molina Wegener Organization: DMW To: freebsd-questions@freebsd.org, Christopher Joyner Date: Thu, 28 Aug 2008 00:46:00 -0400 User-Agent: KMail/1.9.7 References: <898452.32176.qm@web56714.mail.re3.yahoo.com> In-Reply-To: <898452.32176.qm@web56714.mail.re3.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1822109.xeQlmOYend"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200808280046.13657.dmw@unete.cl> Cc: questions@freebsd.org Subject: Re: curses.h, beep() returns ERR, flash() casuses segment fault. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: dmw@unete.cl List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Aug 2008 04:48:29 -0000 --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 > > 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 #include #include 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--