+ 1
How can i assign the values of a void to an integer?
how can i make it so that everytime i cout << playerClass, it gives me health = 50? https://code.sololearn.com/cm7JTHRtB2M8/?ref=app https://code.sololearn.com/cm7JTHRtB2M8/?ref=app
3 ответов
+ 3
I think what you are trying to do is to create an object. Here is a very simple code I made to help:
https://code.sololearn.com/cCFs26CisxE5/?ref=app
If you finish the C++ course, you will learn some of this.
+ 1
we can do in so many way..
i do it this way
#include <iostream>
using namespace std;
int health;
int playerClass;
int Rogue()
{
return health = 50;
}
int main()
{
playerClass = Rogue();
cout<<playerClass ;
}
+ 1
thank you so much