Excuse my english , my program crashes as it is , but when i change the struct member `*name` (string) to `name[50]` and remove the command `(students+i)->name = (char*)malloc(50 * sizeof(char));` the program works fine , so i guess the problem is that i do something wrong when dynamically allocating memory for each name. 

```
#include <stdio.h>
#include <stdlib.h>

struct student
{
    char *name;
    int grade;
};

int main()
{
    int student_number = 0,i;
    struct student *students = NULL;

    printf("Give the number of students: ");
    scanf("%d",&student_number);

    students = (struct student*)malloc(student_number * sizeof(struct student));

    for(i=0;i<student_number;i++)
    {
        (students+i)->name = (char*)malloc(50 * sizeof(char));

        system("CLS");

        printf("Give the name of student no. %d: ",i+1);
        scanf(" %s",&(students+i)->name);
        printf("Give the grade of student no. %d: ",i+1);
        scanf("%d",&(students+i)->grade);
    }

    system("CLS");

    for(i=0;i<student_number;i++)
    {
        printf("%d. %s %d\n",i+1,(students+i)->name,(students+i)->grade);
    }

    system("PAUSE");
    return 0;
}

```