Here is a header file in which I declare and define the class "Sebba": (My character)
int GetHealth(int x);
int Sebba::GetHealth(int x)
And here is the start of a C++ Source Code that I'm using in the game:
6.cout << obj.GetHealth(5);
As you can see, an intenger value is passed through the GetHealth() funcion. What's giving me troubles is this:
On line 6 of my source code, I want obj.Health's value to be printed to the screen. The GetHealth() Function is supposed to have the value 5 passed into it, return it, and print it to the screen. I expected it to print "5" to the screen. Much to my surprise, it printed out "4370436". I tried fixing this by changing intenger types, but after a lot of trouble and headaches, I still can't possibly imagine why it's printing out this number instead of 5. Can someone please help me figure out what's going on here?