#Class object
4 messages · Page 1 of 1 (latest)
class Myclass {
public:
int health;
}
int main() {
return 0;
}
void render() {
}``` where would I put the myclass obj if I had the class in a header file ?
would I do it globally or somewhere else
It really depends on how you want to use it. Globals can work, but they're usually not recommended for several reasons (e.g., testability and maintainability), although sometimes they are unavoidable.