[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sound debugging wanted.

On Fri, Nov 22, 2002 at 04:55:30PM -0800, John D. wrote:

> marco writes:
> >cc beeper.c -o beeper -lcurses
> I get:
> $ cc beeper.c -o beeper -lcurses
> $ a.out
> sh: a.out: not found

You need to  re-read the cc (1) manual page. The  o flag specifies
the name of the output file.

> $ beeper
> About ready to beep
> Memory fault (core dumped)
> Got any ideas on this?

As per Rick Pettit's note, you need this line:

    initscr();  // start curses mode

Note that  initscr() has side  effects, like moving the  cursor to
the top of the screen.

You probably want to get real comfy with the curses documentation.

As an  alternative to  all this, you  may be able  to get  by with
just printing  the bell  character, ^G. It  doesn't work  with all
combinations of  shells and  terminals and languages  and whatnot,
and it's  been years since I  did any serious C  programming, so I
don't remember exactly how it's done  there, but I'll often use ^G
when I can get away with it.



Ben Goren

[demime 0.98d removed an attachment of type application/pgp-signature]

Visit your host, monkey.org