this is my idea:
int main(){
struct mystruct {
char a;
char b;
char c;
char d;
};
struct mystruct structinstance;
//1094795585 is in binary: 01000001 01000001 01000001 01000001 -to dez-> 65 65 65 65 -in ASCII-> AAAA
int myint = 1094795585;
//here the gcc compiler gives me this error (it marked "mystruct"): error: conversion to non-scalar type requested
structinstance = (struct mystruct)(myint);
printf("%c,%c,%c,%c",structinstance.a, structinstance.b, structinstance.c, structinstance.d);
}
The expected result from the printf function would be “AAAA”.
I am having trouble in finding ressources on how to typecast with structs so please share some links if you have any.