cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
unable to print float
unable to print float
Jul 1, 2014 at 10:27pm UTC
dark ninjuh
(51)
Im using ncurses but there seems to be NO WAY that i can print a float to the console. is that really not supported?
Jul 1, 2014 at 11:01pm UTC
Yay295
(431)
Ignore my comment, I skipped over the bit that this was about ncurses.
Last edited on
Jul 1, 2014 at 11:11pm UTC
Jul 1, 2014 at 11:04pm UTC
Peter87
(11238)
You can use printw or similar. It uses the same format as printf.
https://www.mkssoftware.com/docs/man3/curs_printw.3.asp
http://en.cppreference.com/w/cpp/io/c/fprintf
1
2
float
fvalue = 1.2f; printw(
"%f"
, fvalue);
Topic archived. No new replies allowed.