Passing values to functions?

Quick question, if I wanted a function to display values that are stored in the local space (main), would I have to pass the values of each variable to the function for it to know what values to display? Lets say I wanted to display an enemy's stats in a crappy text-based game. The function would most likely be:

1
2
3
4
5
6
7
void EnemyStats()
{
	cout << "Its stats are:\n\
		Health: " << EnemyHealth << endl;
	cout << "Armor: " << EnemyArmor << endl;
	cout << "Level: " << EnemyLevel << endl;
}


This isn't really a big deal, I'm just making a small game for fun in notepad since I'm awake and the question came to mind.

Yes.
Topic archived. No new replies allowed.