This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: several question of standard C++


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]