Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
| From | Nobody <nobody@nowhere.com> |
|---|---|
| Subject | Re: compile C programs for both sunstudio and Visual studio |
| Date | 2011-07-19 12:56 +0100 |
| Message-Id | <pan.2011.07.19.11.56.37.163000@nowhere.com> |
| Newsgroups | comp.lang.c |
| References | <clcm-20110717-0005@plethora.net> <0.dac296d5b2e0c6dcc860.20110718123404BST.87ei1nesb7.fsf@bsb.me.uk> <j01coc$ufi$1@news.m-online.net> <pan.2011.07.18.23.41.33.648000@nowhere.com> <98jv20F8muU1@mid.individual.net> |
| Organization | Zen Internet |
On Tue, 19 Jul 2011 11:47:07 +1200, Ian Collins wrote:
>> If you just need to clear the screen, linking against curses is overkill.
>> system("clear") is the way to go here (and the usual warnings about
>> system() don't really apply here).
>
> Why is using a library function "overkill" compared to spawning a new
> process just to clear the screen?
Because linking creates a hard dependency upon the library. If the library
(or one of its dependencies) doesn't exist, the program fails to run.
Also, curses is a fairly heavyweight library which exerts a lot of
control over the terminal, and which isn't straightforward to use (e.g.
you have to install signal handlers to ensure that the terminal state is
restored if the process is suspended or terminated abnormally).
If you only need to write escape/control sequences in a portable manner,
you're better off using termcap/terminfo to determine the appropriate
sequences. However, there are a lot of portability issues here. E.g.
the choice of the termcap or terminfo database may be coupled to the
choice of the termcap or terminfo API, or it may be orthogonal. Some
systems separate the terminfo API into a separate libtinfo, on others it's
only available via the curses library.
Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
compile C programs for both sunstudio and Visual studio happytoday <ehabaziz2001@gmail.com> - 2011-07-17 22:49 -0500
Re: compile C programs for both sunstudio and Visual studio Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-07-18 12:34 +0100
Re: compile C programs for both sunstudio and Visual studio "Heinrich Wolf" <invalid@invalid.invalid> - 2011-07-18 15:34 +0200
Re: compile C programs for both sunstudio and Visual studio Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-07-18 14:53 +0100
Re: compile C programs for both sunstudio and Visual studio Virchanza <virtual@lavabit.com> - 2011-07-18 07:31 -0700
Re: compile C programs for both sunstudio and Visual studio Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-07-18 15:38 +0100
Re: compile C programs for both sunstudio and Visual studio Kenneth Brody <kenbrody@spamcop.net> - 2011-07-18 14:08 -0400
Re: compile C programs for both sunstudio and Visual studio Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-07-18 19:18 +0100
Re: compile C programs for both sunstudio and Visual studio Nobody <nobody@nowhere.com> - 2011-07-19 00:41 +0100
Re: compile C programs for both sunstudio and Visual studio Ian Collins <ian-news@hotmail.com> - 2011-07-19 11:47 +1200
Re: compile C programs for both sunstudio and Visual studio Keith Thompson <kst-u@mib.org> - 2011-07-18 19:08 -0700
Re: compile C programs for both sunstudio and Visual studio Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-07-22 14:58 +0300
Re: compile C programs for both sunstudio and Visual studio Keith Thompson <kst-u@mib.org> - 2011-07-22 09:42 -0700
Re: compile C programs for both sunstudio and Visual studio Phil Carmody <thefatphil_demunged@yahoo.co.uk> - 2011-07-22 22:32 +0300
Re: compile C programs for both sunstudio and Visual studio Keith Thompson <kst-u@mib.org> - 2011-07-22 13:16 -0700
Re: compile C programs for both sunstudio and Visual studio Nobody <nobody@nowhere.com> - 2011-07-19 12:56 +0100
Re: compile C programs for both sunstudio and Visual studio Kenneth Brody <kenbrody@spamcop.net> - 2011-07-18 14:06 -0400
Re: compile C programs for both sunstudio and Visual studio Keith Thompson <kst-u@mib.org> - 2011-07-18 11:11 -0700
Re: compile C programs for both sunstudio and Visual studio Geoff <geoff@invalid.invalid> - 2011-07-18 18:06 -0500
Re: compile C programs for both sunstudio and Visual studio "Waldek M." <wm@localhost.localdomain> - 2011-07-18 18:07 -0500
Re: compile C programs for both sunstudio and Visual studio BGB <cr88192@hotmail.com> - 2011-07-18 18:07 -0500
Re: compile C programs for both sunstudio and Visual studio "io_x" <a@b.c.invalid> - 2011-07-19 17:40 -0500
Re: compile C programs for both sunstudio and Visual studio "io_x" <a@b.c.invalid> - 2011-07-20 10:43 +0200
Re: compile C programs for both sunstudio and Visual studio "io_x" <a@b.c.invalid> - 2011-07-30 01:48 -0500
Re: compile C programs for both sunstudio and Visual studio Kenneth Brody <kenbrody@spamcop.net> - 2011-07-30 01:48 -0500
Re: compile C programs for both sunstudio and Visual studio "io_x" <a@b.c.invalid> - 2011-07-19 17:40 -0500
csiph-web