This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: several question of standard C++
- To: "liujg" <liu dot jianguo at prosperity dot com dot cn>
- Subject: Re: several question of standard C++
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 17 Apr 2001 18:46:48 -0300
- Cc: <gcc-help at gcc dot gnu dot org>
- Organization: GCC Team, Red Hat
- References: <003101c0c71a$4cf44d50$4100a8c0@prosperity>
On Apr 17, 2001, "liujg" <liu.jianguo@prosperity.com.cn> wrote:
> 1.With ANSI C,which function can be used to change file size similar to chsize() with VC++?
truncate(). I'm not sure it's ANSI, but it's quite common.
> 2.For console program,How do I check keystroke before it appears on
> screen and decide whether show it or not by myself.
You can put the terminal in non-echo mode and disable line-buffering.
Using a library named `curses', `ncurses' or perhaps `termcap' is
probably the easiest way to do it.
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me