struct foo *bar = (struct foo*)malloc(sizeof(struct foo));
struct foo *bar = malloc(sizeof(*bar));
char * buffer = ( char * )malloc( sizeof( char ) * 32 ) ;
If i code for somebody else's preference,i do it their way,if i code for my own consumption,i code it the way it pleases me.