Need some help here it seems to compile fine but crashes at runtime. Am I missing something here?

#include <iostream>
#include <string>
using namespace std;

// player class
class Player{
	int *position;
	void print_pos(){
		cout << "player 1 is in position: " << *position << endl;

Player::Player(){ // main constructor
	position = new int;
	*position = 0;
Player::Player(int pos){  //overloaded constructor
	*position = pos;
Player::~Player(){ // destructor
	delete position;

int main()
	Player one;
	Player two(1);
	return 0;

Look at your "overloaded" constructor. Does it allocate memory? Does it dereference the pointer as if memory were allocated?

commented: excellent +3

Thank you very much I'm learning very fast why c++ guru's are so precise about every minor detail.