But then, in this tutorial on OOP in C, the examples seem to lack that
struct
, even if they don't use thetypedef
"trick".
Here is a sample of what is apparently intended to be C code from that web page:
struct Shape;
struct ShapeType;
ShapeType* ShapeType__create(
…
Since the post is from 6 years ago, I was wondering if the C standard allowed that type of code, or maybe the author of the post is assuming some compilation flags or something else. Or is it just a typo?
No version of the C standard has provided that struct ShapeType
would provide a type that could be used as ShapeType* ShapeType__create…
.