If I understood correctly you can typecast variables into your defined structs to controll how the data is processed. Why do I get the error then, that I have to use an arithmetic data type for the typecast?
This is the example:
//testing if you can typecast an int variable into mystruct
int main(){
char mychararray[2];
struct mystruct {
char c;
};
struct mystruct structinstance;
int myint = 80;
mychararray[1] = (structinstance *)(&myint); //the precompiler tells me the error "error: expression must have arithmetic type" at "structinstance"
} //the gcc compiler tells me this error (it marked the closing bracket -> ")" of "(structinstance*)" ): "error: expected expression before ')' token: mychararray[1] = (structinstance *) (&myint);"
I know that I can just typecast into char to achieve the same thing, I just wanted to test how this typecasting into your own specified datatypes(structs) works.
1