I know this may sound stupid but, why is this function I implemented not working properly?
I get the following error in the terminal:
cerinta3.c: In function ‘void realocare_memorie(student**, int)’:
cerinta3.c:9:19: error: invalid conversion from ‘void*’ to ‘student*’ [-fpermissive]
9 | *vector = realloc(*vector, dimensiune * sizeof(student));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| void*
void realocare_memorie (student **vector, int dimensiune) {
*vector = realloc(*vector, dimensiune * sizeof(student));
}