dimanche 10 janvier 2021

Initialize a class on top level that's defined bottom level in the same header file

Might be a dumb question. My apologies, but I would like to do the below,

connectionState currentState;

class connectionState {
    public:
        .......
        .......
};

rather

class connectionState {
    public:
        .......
        .......
};

connectionState currentState;

The former doesn't compiles at all while the latter does. So, no way to do this?

Aucun commentaire:

Enregistrer un commentaire