You forgot to place a semicolon
typedef struct at atom;
struct at {
int element = 5;
struct at *next;
}
^^^^
Take into account that it is a C++ code. In C you may not initialize data members of a structure within its definition.
This declaration
typedef struct at atom;
declares two things. First of all it declares new type struct at
in the current declarative region. And it declares an alias for this type atom
It is not necessary that each declaration would be at the same time a definition.
At first struct at
is declared and then it is defined
struct at {
int element = 5;
struct at *next;
};
Compare thsi approach for example with functions. Functions also may be several times declared and only one time defined. For example
void f();
void f();
//...
void f();
void f() { std::cout << "It is a joke" << std::endl; }
The same way a structure may be several times declared but only one time defined.