struct ArrayQueue *Q = (struct ArrayQueue*)malloc(sizeof(struct ArrayQueue));
vs
struct ArrayQueue *Q = malloc(sizeof(struct ArrayQueue));
I am bit confused as to what to use when and exactly what difference do they bear? Intuitively, I feel the first usage is when I'm writing within a function and the second would be when I'm writing within a structure.