I changed your code you gave me a little bit and it still runs great, for now. Lol.
Code:
//main.cpp
#include "player_stats.hpp"
#include <iostream>
#include <allegro.h>
int main(){
allegro_init();
Player protagonist;
protagonist.setClass(0);
Player player;
player.setClass(1);
std::cout << protagonist.getClass() << "\n\n";
std::cout << player.getClass() << "\n\n";
std::cin.get();
return 0;}
END_OF_MAIN();
Code:
//player_class.cpp
#include "player_stats.hpp"
void Player::setClass(int pClass){
this -> pClass = pClass;}
int Player::getClass() const{
return pClass;}
Code:
//player_stats.hpp
//#ifndef PLAYER_H
//#define PLAYER_H
class Player{
private:
int pClass;
public:
void setClass(int pClass);
int getClass() const;};
//#endif
I commented those out so I can think more on taking them out. Tell me what you think though! ;]