2

I'm trying to learn about casts and how they work. I have this

(Defined in the Header file)

typedef struct {
    int code;
    char* name;
    float concentration;
    int quantity;
} Farmacy;

In the .c file when I'm creating a new object when should I use:

Farmacy* f= malloc(sizeof(Farmacy));

or

Farmacy* f= (Farmacy*)malloc(sizeof(Farmacy));
Alex
  • 31
  • 3

0 Answers0