I want to initialize a struct element, split in declaration and initialization. This is what I have:
typedef struct MY_TYPE { bool flag; short int value;
Structure in C can be declared and initialized like this:
typedef struct book { char title[10]; char author[10]; float price; } book; int main() { book b1={"DS", "Ajay", 250.0}; printf("%s \t %s \t %f", b1.title, b1.author, b1.price); return 0; }