Professionally... for one, don't use system("pause") (thread in the beginner forum describing why). Two, comment your code. You have no idea how helpful it is when you can look at a code and see all of the comments of what is going on in the code, rather than having to figure it out yourself. Three... you could use a constructor to set playeratt and enemydef versus calling a function. Four, it would be nicer if there was a function inside of the class attack which displayed the player attack, enemy defense, and the enemy HP left. That, versus having to display it in main(). Five, some people will nitpick you for using namespace std versus placing std:: in front of cout, et cetera... Actually, if you do create a function inside of attack that displays all the information needed to be displayed, you can get rid of all of those functions that just state the values from the code. It will make it more compact in the end.
yeah i guess i should have commented sorry :/ i will if i ever post again. and yeah its been a LONG time since ive done any of this i had completely forgot about how bad using system("pause"); was.and what do you mean by " you could use a constructor to set playeratt and enemydef versus calling a function."?
and for " a function inside of attack that displays all the information needed to be displayed, you can get rid of all of those functions that just state the values from the code. It will make it more compact in the end." well if i did make this bigger just for practice i would need those separate so i could set them to what i need and displayed in different ways, orders.