C (and C++) considers the declaration to be separate from the definition, though you can combine them. The declaration is the name + type, definition provides a value. The example code is meant to illustrate separate declaration and definition with some code (the call to `f`) between the two.
If you try to use `x` before it is defined (the assignment) your compiler should give you a warning, at least. If it doesn't, find a new compiler.
For block-scope declarations, it's not the definition but the initialization that you're thinking of. At least in C, every block-scope variable declaration is a definition:
> A definition of an identifier is a declaration for that identifier that:
> — for an object, causes storage to be reserved for that object; [...]
But initialization (in C) does not occur for block-scope objects without the optional initializer.
Okay, that's somewhat confusing. So a declaration is when the identifier enters the scope, and a definition is for a variable specifically. So a declaration that's not a definition could be a forward declaration for a function, or a typedef.
but to be pedantic, i think you mean define rather than declare, though of course you can also declare things at different scopes.