Okay so this is what should be a simple enough code, i just want to create a function that will decrease the nHealth Value by the nAttack Value then output that value the screen.
Your function doesn't do anything to modify your other values. It creates local variables called nHealth and nAttack, but these have no relation to your struct's properties.
It then returns an int, but your code doesn't do anything with this returned value.
Edit:
One option would be to use a reference instead
1 2 3 4
void attacked(int &health, int attack)
{
health = health - attack;
}
Since this is C++, I would suggest using classes instead, and have "takeDamage()" (or something) be a method in your class.