dimanche 15 mars 2015

Not quite understanding forward declaration of definitions in classes


So I'm a little confused about how this works. I've followed other examples to come up with the following:



//in entity.h
#pragma once

class Entity
{
int nEntity;
};


//in entity.cpp
#include "entity.h"

Entity::Entity
{
nEntity = 5;
}


and I'm not sure why the compiler doesn't like it. Any hints?




Aucun commentaire:

Enregistrer un commentaire