I am a beginner at programming. What are the differences between the use of malloc() mentioned below? I use the first method, but I have seen the second one being used too. I'm a little confused. Thanks for your help :)
int *ptr;
ptr = malloc(sizeof(int));
int *ptr;
ptr = (int *)malloc(sizeof(int));