I am trying to allocate memory to structure dynamically but i am getting error while allocation the memory dynamically
#include <string>
using namespace std;
#define MAX_GRADES 5
typedef struct _Student
{
string id;
string name;
double grades[MAX_GRADES];
double average;
}Student;
Student *update_list;
int main()
{
Student *n = (*Student) malloc(sizeof(n));
return 0;
}
main.cpp: In function ‘int main()’:
main.cpp:26:24: error: expected primary-expression before ‘)’ token
Student *n = (*Student) malloc(sizeof(Student));
^