struct student
{
char name[128];
int age;
int gender;
int courseCode;
};
Sorry for my bad skills , for this code , how I use new operator to create a dynamic array of n student instances? N is an integer that I defined already .
thanks , easy to get what you mean for this code .
by the way , how I want to return the value of the new operator ? in the event the computer cannot allocate the requested memory . Erm , for some example , how should I write the code to check if the new actually succeeded?
sorry .. still in progress of structure since I still having diploma..
The first version allocates size bytes of storage space, aligned to represent an array object of that size (or less, if the implementation uses array overhead), and returns a non-null pointer to the first byte of this block. On failure, it throws a bad_alloc exception.