I seem to be having some issues with malloc in my code. Here's what's going on. I've got a struct created with a few values in it. From there, I'd like to make an array of structs. I think I've got the struct right, and some of the pointers, but I'm not sure.
Here's the struct:
typedef struct{ char name[25]; int courseID; } course; From there, I try to initiate the new struct and malloc it at the same time by this:
course *courses = malloc(25*sizeof(course)); From here, I'm getting the error:
Invalid conversion from 'void*' to 'course*' [-fpermissive] course *courses = malloc(25*sizeof(course));
I don't really know what this means... I know I may be completely off course with this whole idea, so any help y'all can give would be great!
gcc, or change the corresponding option in your IDE.