The typedef
is one of the things C doesn’t use much in C++, but it depends on the situation.
The definition of a struct
already is typedefed (every compound structure definition is already a type defined in the code) by C++ automatically, so there is no reason to use it in this situation, even if it is accepted by compatibility. The same goes for new language constructions that resemble.
And to create a alias type is recommended to adopt the using
in place of typedef
, at least in almost all situations. This is a more modern and better way.
typedef
is compatible withc++
https://en.cppreference.com/w/cpp/language/typedef– Ricardo Pontual