Why in Xcode I have error in line:
my_type a;
there must be (according to Xcode):
struct my_type a;
But in TOR code I see what they do not use struct before variable declaration.
how does it work?
Okay, so structs in C. You have two options. You can do something like
struct a {
...
};
struct a a1;
//OR
typedef struct a {
} a;
a a1;
atype instead of just a? Nothing prevents you from giving the same name.atype is more descriptive, then use typedef struct atype { ... } atype
my_typeis atypedefor you're compiling with a C++ compiler.