lundi 11 octobre 2021

How can I write variable definition without declaration?

I can write declaration or declaration with definition. Examples:

int x = 1; // declaration and definition
extern int x; // only declaration
bool f(); // only declaration
bool g() {} // declaration and definition
class X; // declaration
class X {}; // declaration and definition

So we can see that this is possible to write only declaration and declaration with definition. But how I can write only definition? I heard that this is possible.

Aucun commentaire:

Enregistrer un commentaire