Values not sticking around after function call sets them

I've been making an RPG program, and I'm at a roadblock once again. Thanks to the people here I've made a combat system for the game that relies upon fast reaction times with the NCURSES library, but I cannot seem to output the stats. When I compile my program, my code runs fine, but the output is inaccurate. What I discovered is that somehow, when I call outPutStats();, only the level and classNum are being saved when the constructor is called.

example output:

Level: 1
Class Num: 1
Max Health: 0
Damage: 0

This is in spite of the fact that the constructor sets the health/maxhealth/etcetera, the damage and what not, etc, yet outPutStats(); doesn't seem to have the right values somehow. I'm looking to see if I have a logistics problem somewhere, because I've searched far and wide but cannot find it.

https://www.onlinegdb.com/fork/r1iKTCPeV
fork link where I compile/code the thing.

Edit: I figured it out, printw(%d) outputs an integer but not a floating point, so my question now I suppose is that how do I output a floater in similar fashion?

Edit 2: Well looks like you just need a %f and my program is fine thus far.
Last edited on
Topic archived. No new replies allowed.