[SLE] Print integer in ncurses?
This might be off-topic, but I am having a helluva time figuring out how to print an integer to a window in ncurses. It seems as though all the addstr() or addch() functions can handle is a char*, so do I have to convert my integer into an ASCII value with sprintf()? It just seems really strange that I will have to sprintf() every number my program calculates into a char*. Is there another way? Thanks! Stuart -- Stuart Hall Cheshire, Connecticut, USA Linux User# 141732 -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
Hi, On Tue, Apr 11 2000 at 19:46 +0000, Stuart Hall wrote:
This might be off-topic, but I am having a helluva time figuring out how to print an integer to a window in ncurses. It seems as though all the addstr() or addch() functions can handle is a char*, so do I have to convert my integer into an ASCII value with sprintf()?
No, just use printw("%d", integer) or wprintw(window, "%d", integer). Ciao, Stefan -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/Support/Doku/FAQ/
participants (2)
-
stefan.troeger@wirtschaft.tu-chemnitz.de
-
stuarthall@mailandnews.com