Program Showing Student Names and Marks

I need some help
I am trying to build a c++ program which should ask the user for the size of the class and use this to allocate suitable arrays to store the names and marks of the students (these will be separate arrays, i.e. one for name and one for mark). Marks will be between 0 and 100. Then the program should request the entry of a name and mark for each student in the class.The program should print the names and marks in the order they were entered.The program should calculate the average mark
The program should display the names of the students who had marks below 40%.
here is the code I have got so far:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>


int main(void)
{
char **name;
char studentName[50];
const int NAME_SIZE=50;
const int MAX_MARKS = 100;// Declare variable for student marks
int totalStudents;
int i;


printf("How many Students are there? and what are their Marks?\n");
scanf_s("%d",&totalStudents);
name=(char**)malloc(totalStudents*sizeof(char*));

for(i=0; i<totalStudents; i++)
{
printf("Enter the Student Name Below\n");
name[i]=(char*)malloc(NAME_SIZE*sizeof(char));
scanf_s("%s",&name[i]);

printf("Enter the Student Marks Below\n");

while(MAX_MARKS < 0 || MAX_MARKS > 100)
{
if(MAX_MARKS < 0 || MAX_MARKS < 100)
{
printf("Invalid Number entered! Please try again");
}
}

delete(studentName);

void operator delete[](void*NAME_SIZE);

delete(name);
name=NULL;

void operator delete[](void*MAX_MARKS);

}

}
Anybody got any pointers or ideas for me
Thank you
Topic archived. No new replies allowed.